TSDuck v3.40-4033
MPEG Transport Stream Toolkit
|
Global tweaks to manipulate, parse and format XML documents. More...
#include <tsxmlTweaks.h>
Public Member Functions | |
Tweaks ()=default | |
Default constructor. | |
UChar | attributeValueOtherQuote () const |
The quote character which is different from the one to use for attribute values. | |
UChar | attributeValueQuote () const |
The type of quote to use for attribute values. | |
void | defineArgs (Args &args) |
Add command line option definitions in an Args. | |
bool | loadArgs (DuckContext &duck, Args &args) |
Load arguments from command line. | |
Public Attributes | |
bool | attributeValueDoubleQuote = true |
If true, use double quotes for attribute values. | |
bool | strictAttributeFormatting = true |
How to escape characters in attribute values. | |
bool | strictTextNodeFormatting = false |
How to escape characters in text nodes. | |
bool | x2jCollapseText = false |
In the XML-to-JSON conversion without model, collapse spaces in all text nodes. | |
bool | x2jEnforceBoolean = false |
In the XML-to-JSON conversion without model, enforce the creation of a JSON boolean when possible. | |
bool | x2jEnforceInteger = false |
In the XML-to-JSON conversion without model, enforce the creation of a JSON number when possible. | |
bool | x2jIncludeRoot = false |
In the XML-to-JSON conversion, keep the root of the XML document as a JSON object. | |
bool | x2jTrimText = false |
In the XML-to-JSON conversion without model, trim all text nodes. | |
Global tweaks to manipulate, parse and format XML documents.
Each document is associated with a Tweaks structure.
void ts::xml::Tweaks::defineArgs | ( | Args & | args | ) |
Add command line option definitions in an Args.
[in,out] | args | Command line arguments to update. |
bool ts::xml::Tweaks::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. |
|
inline |
The type of quote to use for attribute values.
|
inline |
The quote character which is different from the one to use for attribute values.
bool ts::xml::Tweaks::attributeValueDoubleQuote = true |
If true, use double quotes for attribute values.
If false, use single quote. The default is true.
bool ts::xml::Tweaks::strictAttributeFormatting = true |
How to escape characters in attribute values.
When true, all 5 special characters '"&<>
are escaped in attribute values and the attributeValueQuote() character is used as quote.
When false, a more human-readable but not strictly XML-compliant format is used. If the value contains only single or double quotes, the other character is used to enclose the value. Only the ampersand and the selected quote character is escaped.
The default is true.
bool ts::xml::Tweaks::strictTextNodeFormatting = false |
How to escape characters in text nodes.
When true, all 5 special characters '"&<>
are escaped in text nodes. When false, a more human-readable but not strictly XML-compliant format is used: only the 3 characters &<>
are escaped.
The default is false.
bool ts::xml::Tweaks::x2jIncludeRoot = false |
In the XML-to-JSON conversion, keep the root of the XML document as a JSON object.
The default is false.
bool ts::xml::Tweaks::x2jEnforceInteger = false |
In the XML-to-JSON conversion without model, enforce the creation of a JSON number when possible.
The default is false.
bool ts::xml::Tweaks::x2jEnforceBoolean = false |
In the XML-to-JSON conversion without model, enforce the creation of a JSON boolean when possible.
The default is false.
bool ts::xml::Tweaks::x2jTrimText = false |
In the XML-to-JSON conversion without model, trim all text nodes.
The default is false.
bool ts::xml::Tweaks::x2jCollapseText = false |
In the XML-to-JSON conversion without model, collapse spaces in all text nodes.
The default is false.