![]() |
TSDuck v3.46-4964
MPEG Transport Stream Toolkit
|
#include <tsTablePatchXML.h>
Public Member Functions | |
| TablePatchXML (DuckContext &duck) | |
| void | addPatchFileName (const UString &filename) |
| void | addPatchFileNames (const UStringList &filenames) |
| void | addPatchFileNames (const UStringVector &filenames) |
| bool | applyPatches (BinaryTable &table) const |
| bool | applyPatches (SectionPtr §ion) const |
| void | applyPatches (xml::Document &doc) const |
| void | clear () |
| void | defineArgs (Args &args) |
| bool | getExpandEnvironment () const |
| bool | hasPatchFiles () const |
| bool | loadArgs (DuckContext &duck, Args &args) |
| bool | loadPatchFiles (const xml::Tweaks &tweaks=xml::Tweaks()) |
| void | setExpandEnvironment (bool expand) |
Implementation of on-the-fly table patching using XML. This class is typically used to handle --patch-xml command line options.
|
inline |
Constructor.
| [in,out] | duck | TSDuck execution context. |
| void ts::TablePatchXML::defineArgs | ( | Args & | args | ) |
Add command line option definitions in an Args.
| [in,out] | args | Command line arguments to update. |
| bool ts::TablePatchXML::loadArgs | ( | DuckContext & | duck, |
| Args & | args ) |
Load arguments from command line. Args error indicator is set in case of incorrect arguments.
| [in,out] | duck | TSDuck execution context. |
| [in,out] | args | Command line arguments. |
| void ts::TablePatchXML::clear | ( | ) |
Clear all previously loaded patch files, clear list of patch files.
|
inline |
Check if there is some patch to apply. When false, no patch file was specified or loaded.
| void ts::TablePatchXML::addPatchFileName | ( | const UString & | filename | ) |
Add a file name in the list of patch files. The file is not yet loaded.
| [in] | filename | Name of an XML patch file. |
| void ts::TablePatchXML::addPatchFileNames | ( | const UStringVector & | filenames | ) |
Add file names in the list of patch files. The files are not yet loaded.
| [in] | filenames | Names of XML patch files. If a file name starts with "<?xml", this is considered as "inline XML content". |
| void ts::TablePatchXML::addPatchFileNames | ( | const UStringList & | filenames | ) |
Add file names in the list of patch files. The files are not yet loaded.
| [in] | filenames | Names of XML patch files. If a file name starts with "<?xml", this is considered as "inline XML content". |
|
inline |
Set expansion of environment variables in patch files.
| [in] | expand | If true, expand all environment variables in the patch files before patching. More precisely, each patch file is internally duplicated first and then all environment variables are expanded in that copy. Therefore, if this TablePatchXML instance is used several times and the values of the environment variables changed in the meantime, the latest up-to-date values are always used. |
|
inline |
Check if expansion of environment variables is performed in patch files.
| bool ts::TablePatchXML::loadPatchFiles | ( | const xml::Tweaks & | tweaks = xml::Tweaks() | ) |
Load (or reload) the XML patch files.
| [in] | tweaks | XML tweaks to load in the documents. |
| void ts::TablePatchXML::applyPatches | ( | xml::Document & | doc | ) | const |
Apply the XML patch files to an XML document.
| [in,out] | doc | The XML document to patch. |
| bool ts::TablePatchXML::applyPatches | ( | BinaryTable & | table | ) | const |
Apply the XML patch files to a binary table.
| [in,out] | table | The binary table to patch. |
| bool ts::TablePatchXML::applyPatches | ( | SectionPtr & | section | ) | const |
Apply the XML patch files to a binary section. This is a special processing since XML files are supposed to represent complete tables. The section is considered as section 0/0 of a complete table. The patch is applied on that table and the first section of the patched table is returned. Specific parts of the section are preserved, such as section number or last section number.
| [in,out] | section | Safe pointer to the section to patch. The pointer is modified, pointing to a new section content. |