Command line arguments for JSON reports (--json
, --json-line
, --json-udp
).
More...
Public Member Functions | |
OutputArgs (bool use_short_opt=false, const UString &help=UString()) | |
Default constructor. More... | |
virtual | ~OutputArgs () override |
Virtual destructor. | |
virtual void | defineArgs (Args &args) override |
Add command line option definitions in an Args. More... | |
virtual bool | loadArgs (DuckContext &duck, Args &args) override |
Load arguments from command line. More... | |
bool | report (const json::Value &root, json::RunningDocument &doc, Report &rep) |
Issue a JSON report according to options. More... | |
bool | report (const json::Value &root, std::ostream &stm, Report &rep) |
Issue a JSON report according to options. More... | |
void | setHelp (const UString &text) |
Set the help text for the --json option. More... | |
bool | useFile () const |
Check if JSON file output option is specified. More... | |
bool | useJSON () const |
Check if any JSON output option is specified. More... | |
Command line arguments for JSON reports (--json
, --json-line
, --json-udp
).
Default constructor.
[in] | use_short_opt | Define 'j' as short option for --json . |
[in] | help | Help text for option --json . |
|
inline |
Set the help text for the --json
option.
Must be called before defineArgs().
[in] | text | Help text for the --json option. |
|
overridevirtual |
Add command line option definitions in an Args.
[in,out] | args | Command line arguments to update. |
Implements ts::ArgsSupplierInterface.
|
overridevirtual |
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. |
Implements ts::ArgsSupplierInterface.
|
inline |
Check if any JSON output option is specified.
|
inline |
Check if JSON file output option is specified.
bool ts::json::OutputArgs::report | ( | const json::Value & | root, |
std::ostream & | stm, | ||
Report & | rep | ||
) |
Issue a JSON report according to options.
[in] | root | JSON root object. |
[in] | stm | Output stream when --json is specified. |
[in] | rep | Logger to report errors or output one-line JSON when --json-line is specified. |
bool ts::json::OutputArgs::report | ( | const json::Value & | root, |
json::RunningDocument & | doc, | ||
Report & | rep | ||
) |
Issue a JSON report according to options.
[in] | root | JSON root object. |
[in] | doc | Output running document when --json is specified. |
[in] | rep | Logger to report errors or output one-line JSON when --json-line is specified. |