![]() |
TSDuck v3.46-4965
MPEG Transport Stream Toolkit
|
#include <tsjsonOutputArgs.h>
Public Member Functions | |
| OutputArgs (Report *report) | |
| virtual | ~OutputArgs () |
| void | defineArgs (Args &args, bool use_short_opt, const UString &description, bool allow_file=true) |
| bool | loadArgs (Args &args) |
| bool | report (const json::Value &root, const fs::path &file_name, Report &rep) |
| bool | report (const json::Value &root, json::RunningDocument &doc, Report &rep) |
| bool | report (const json::Value &root, Report &rep) |
| bool | report (const json::Value &root, std::ostream &stm, Report &rep) |
| bool | useFile () const |
| bool | useJSON () const |
Command line arguments for JSON reports (--json, --json-line, --json-udp, --json-tcp).
|
explicit |
Constructor.
| [in] | report | Where to report errors. The report object must remain valid as long as this object exists. If report is null, log messages are discarded. |
|
virtual |
Virtual destructor.
| 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.
| [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. |
| bool ts::json::OutputArgs::loadArgs | ( | Args & | args | ) |
|
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, |
| const fs::path & | file_name, | ||
| Report & | rep ) |
Issue a JSON report according to options.
| [in] | root | JSON root object. |
| [in] | file_name | Output file name when --json is specified. If the specified file is empty or "-", use the standard output. |
| [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, |
| 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. |
| bool ts::json::OutputArgs::report | ( | const json::Value & | root, |
| Report & | rep ) |
Issue a JSON report according to options (assuming --json is not specified for output files).
| [in] | root | JSON root object. |
| [in] | rep | Logger to report errors or output one-line JSON when --json-line is specified. |