Implementation of on-the-fly table patching using XML.
More...
#include <tsTablePatchXML.h>
Implementation of on-the-fly table patching using XML.
This class is typically used to handle --patch-xml command line options.
◆ TablePatchXML()
Constructor.
- Parameters
-
[in,out] | duck | TSDuck execution context. |
◆ defineArgs()
void ts::TablePatchXML::defineArgs |
( |
Args & |
args | ) |
|
Add command line option definitions in an Args.
- Parameters
-
[in,out] | args | Command line arguments to update. |
◆ loadArgs()
Load arguments from command line.
Args error indicator is set in case of incorrect arguments.
- Parameters
-
[in,out] | duck | TSDuck execution context. |
[in,out] | args | Command line arguments. |
- Returns
- True on success, false on error in argument line.
◆ hasPatchFiles()
bool ts::TablePatchXML::hasPatchFiles |
( |
| ) |
const |
|
inline |
Check if there is some patch to apply.
When false, no patch file was specified or loaded.
- Returns
- True if there is some patch to apply.
◆ addPatchFileName()
void ts::TablePatchXML::addPatchFileName |
( |
const UString & |
filename | ) |
|
Add a file name in the list of patch files.
The file is not yet loaded.
- Parameters
-
[in] | filename | Name of an XML patch file. |
◆ addPatchFileNames() [1/2]
void ts::TablePatchXML::addPatchFileNames |
( |
const UStringVector & |
filenames | ) |
|
Add file names in the list of patch files.
The files are not yet loaded.
- Parameters
-
[in] | filenames | Names of XML patch files. If a file name starts with "<?xml", this is considered as "inline XML content". |
◆ addPatchFileNames() [2/2]
void ts::TablePatchXML::addPatchFileNames |
( |
const UStringList & |
filenames | ) |
|
Add file names in the list of patch files.
The files are not yet loaded.
- Parameters
-
[in] | filenames | Names of XML patch files. If a file name starts with "<?xml", this is considered as "inline XML content". |
◆ loadPatchFiles()
Load (or reload) the XML patch files.
- Parameters
-
[in] | tweaks | XML tweaks to load in the documents. |
- Returns
- True on success, false some error occurred in the input files.
◆ applyPatches() [1/3]
void ts::TablePatchXML::applyPatches |
( |
xml::Document & |
doc | ) |
const |
Apply the XML patch files to an XML document.
- Parameters
-
[in,out] | doc | The XML document to patch. |
◆ applyPatches() [2/3]
bool ts::TablePatchXML::applyPatches |
( |
BinaryTable & |
table | ) |
const |
Apply the XML patch files to a binary table.
- Parameters
-
[in,out] | table | The binary table to patch. |
- Returns
- True on success, false if the binary table or the patched XML is invalid. If the patch file deletes the table, then the returned value if true and the table is marked as invalid.
◆ applyPatches() [3/3]
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.
- Parameters
-
[in,out] | section | Safe pointer to the section to patch. The pointer is modified, pointing to a new section content. |
- Returns
- True on success, false if the binary section or the patched XML is invalid. If the patch file deletes the table, then the returned value if true and section is null.
The documentation for this class was generated from the following file: