TSDuck Version 3.32-2769 (TSDuck - The MPEG Transport Stream Toolkit)
ts::json::OutputArgs Class Reference

Command line arguments for JSON reports (--json, --json-line, --json-udp). More...

Inheritance diagram for ts::json::OutputArgs:
Collaboration diagram for ts::json::OutputArgs:

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...
 

Detailed Description

Command line arguments for JSON reports (--json, --json-line, --json-udp).

Constructor & Destructor Documentation

◆ OutputArgs()

ts::json::OutputArgs::OutputArgs ( bool  use_short_opt = false,
const UString help = UString() 
)

Default constructor.

Parameters
[in]use_short_optDefine 'j' as short option for --json.
[in]helpHelp text for option --json.

Member Function Documentation

◆ setHelp()

void ts::json::OutputArgs::setHelp ( const UString text)
inline

Set the help text for the --json option.

Must be called before defineArgs().

Parameters
[in]textHelp text for the --json option.

◆ defineArgs()

virtual void ts::json::OutputArgs::defineArgs ( Args args)
overridevirtual

Add command line option definitions in an Args.

Parameters
[in,out]argsCommand line arguments to update.

Implements ts::ArgsSupplierInterface.

◆ loadArgs()

virtual bool ts::json::OutputArgs::loadArgs ( DuckContext duck,
Args args 
)
overridevirtual

Load arguments from command line.

Args error indicator is set in case of incorrect arguments.

Parameters
[in,out]duckTSDuck execution context.
[in,out]argsCommand line arguments.
Returns
True on success, false on error in argument line.

Implements ts::ArgsSupplierInterface.

◆ 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/2]

bool ts::json::OutputArgs::report ( const json::Value root,
std::ostream &  stm,
Report rep 
)

Issue a JSON report according to options.

Parameters
[in]rootJSON root object.
[in]stmOutput stream when --json is specified.
[in]repLogger to report errors or output one-line JSON when --json-line is specified.
Returns
True on success, false on error.

◆ report() [2/2]

bool ts::json::OutputArgs::report ( const json::Value root,
json::RunningDocument doc,
Report rep 
)

Issue a JSON report according to options.

Parameters
[in]rootJSON root object.
[in]docOutput running document when --json is specified.
[in]repLogger 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: