Command line arguments for JSON reports (--json
, --json-line
, --json-udp
, --json-tcp
).
More...
#include <tsjsonOutputArgs.h>
|
| OutputArgs ()=default |
| Default constructor.
|
|
virtual | ~OutputArgs () |
| Virtual destructor.
|
|
void | defineArgs (Args &args, bool use_short_opt, const UString &description, bool allow_file=true) |
| Add command line option definitions in an Args.
|
|
bool | loadArgs (DuckContext &duck, Args &args) |
| Load arguments from command line.
|
|
bool | report (const json::Value &root, json::RunningDocument &doc, Report &rep) |
| Issue a JSON report according to options.
|
|
bool | report (const json::Value &root, Report &rep) |
| Issue a JSON report according to options (assuming --json is not specified for output files).
|
|
bool | report (const json::Value &root, std::ostream &stm, Report &rep) |
| Issue a JSON report according to options.
|
|
bool | useFile () const |
| Check if JSON file output option is specified.
|
|
bool | useJSON () const |
| Check if any JSON output option is specified.
|
|
Command line arguments for JSON reports (--json
, --json-line
, --json-udp
, --json-tcp
).
◆ defineArgs()
void ts::json::OutputArgs::defineArgs |
( |
Args & |
args, |
|
|
bool |
use_short_opt, |
|
|
const UString & |
description, |
|
|
bool |
allow_file = true |
|
) |
| |
Add command line option definitions in an Args.
- Parameters
-
[in,out] | args | Command line arguments to update. |
[in] | use_short_opt | Define 'j' as short option for --json . Ignored if allow_file is false. |
[in] | description | Description of the JSON information. Also used as help text for option --json . |
[in] | allow_file | If false, the option --json is not defined, only log and network options are defined. |
◆ 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.
◆ useJSON()
bool ts::json::OutputArgs::useJSON |
( |
| ) |
const |
|
inline |
Check if any JSON output option is specified.
- Returns
- True if any JSON output option is specified.
◆ useFile()
bool ts::json::OutputArgs::useFile |
( |
| ) |
const |
|
inline |
Check if JSON file output option is specified.
- Returns
- True if JSON file output option is specified.
◆ report() [1/3]
bool ts::json::OutputArgs::report |
( |
const json::Value & |
root, |
|
|
std::ostream & |
stm, |
|
|
Report & |
rep |
|
) |
| |
Issue a JSON report according to options.
- Parameters
-
[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. |
- Returns
- True on success, false on error.
◆ report() [2/3]
Issue a JSON report according to options.
- Parameters
-
[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. |
- Returns
- True on success, false on error.
◆ report() [3/3]
Issue a JSON report according to options (assuming --json
is not specified for output files).
- Parameters
-
[in] | root | JSON root object. |
[in] | rep | Logger to report errors or output one-line JSON when --json-line is specified. |
- Returns
- True on success, false on error.
The documentation for this class was generated from the following file: