TSDuck v3.38-3696
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::json::OutputArgs Class Reference

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

#include <tsjsonOutputArgs.h>

Public Member Functions

 OutputArgs ()=default
 Default constructor.
 
virtual ~OutputArgs ()
 Virtual destructor.
 
void defineArgs (Args &args, bool use_short_opt, const UString &help=UString())
 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, 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.
 

Detailed Description

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

Member Function Documentation

◆ defineArgs()

void ts::json::OutputArgs::defineArgs ( Args args,
bool  use_short_opt,
const UString help = UString() 
)

Add command line option definitions in an Args.

Parameters
[in,out]argsCommand line arguments to update.
[in]use_short_optDefine 'j' as short option for --json.
[in]helpHelp text for option --json.

◆ loadArgs()

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

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.

◆ 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: