AJA NTV2 SDK
17.1.3.1410
NTV2 SDK 17.1.3.1410
|
#include <commandline.h>
Public Member Functions | |
AJACommandLineParser (int flags=0) | |
AJACommandLineParser (const std::string &name, int flags=0) | |
AJACommandLineParser (const AJACommandLineParser &other) | |
~AJACommandLineParser () | |
void | operator= (const AJACommandLineParser &other) |
void | Reset (bool clearAll=false) |
void | Dump () |
bool | OptionByName (const std::string &name, AJACommandLineOption &opt) const |
bool | AddSubParser (AJACommandLineParser *sp) |
void | ParseArgs (const AJAStringList &args) |
void | ParseArgs (int argc, const char *argv[]) |
void | ParseArgs (int argc, char *argv[]) |
bool | IsSet (const std::string &name) const |
AJAVariant | Value (const std::string &name, size_t index=0) const |
AJAVariantList | Values (const std::string &name) const |
std::string | ValueString (const std::string &name, size_t index=0) const |
AJAStringList | ValueStrings (const std::string &name) const |
bool | AddOption (const AJACommandLineOption &option) |
bool | AddOptions (const std::vector< AJACommandLineOption > &options) |
bool | AddHelpOption () |
std::string | GetName () const |
void | SetUsageText (const std::string &usageText) |
std::string | GetUsageText () const |
void | SetHelpText (const std::string &helpText) |
std::string | GetHelpText () const |
std::string | GetCommandName () |
AJAStringList | GetKnownOptions () |
AJAStringList | GetUnknownOptions () |
Class that represents a command line args parser.
Definition at line 139 of file commandline.h.
|
explicit |
Definition at line 144 of file commandline.cpp.
|
explicit |
Definition at line 150 of file commandline.cpp.
AJACommandLineParser::AJACommandLineParser | ( | const AJACommandLineParser & | other | ) |
Definition at line 156 of file commandline.cpp.
AJACommandLineParser::~AJACommandLineParser | ( | ) |
Definition at line 161 of file commandline.cpp.
bool AJACommandLineParser::AddHelpOption | ( | ) |
Add help option to this args parser. If -h/–help is specified from the command line, will print the help string.
Definition at line 486 of file commandline.cpp.
bool AJACommandLineParser::AddOption | ( | const AJACommandLineOption & | option | ) |
Add a command line option to this args parser. This method will fail if another option with the same name has already been added to this parser.
[in] | option | The command line option to add. |
true
if option was added successfully, otherwise false
. Definition at line 451 of file commandline.cpp.
bool AJACommandLineParser::AddOptions | ( | const std::vector< AJACommandLineOption > & | options | ) |
Add a list of command line options to this args parser. This method will fail if the list contains an option whose name has already been added to the args parser.
[in] | options | The list of command line options to add. |
true
if options are added successfully, otherwise false
. Definition at line 476 of file commandline.cpp.
bool AJACommandLineParser::AddSubParser | ( | AJACommandLineParser * | sp | ) |
Register another AJACommandLineParser instance with this parser.
[in] | sp | The subparser to add. |
true
if the subparser was added successfully, otherwise false
. Definition at line 240 of file commandline.cpp.
void AJACommandLineParser::Dump | ( | ) |
Definition at line 195 of file commandline.cpp.
std::string AJACommandLineParser::GetCommandName | ( | ) |
Get the name of the command (if-any) represented by this args parser.
Definition at line 632 of file commandline.cpp.
std::string AJACommandLineParser::GetHelpText | ( | ) | const |
Get the help text string for this args parser.
Definition at line 608 of file commandline.cpp.
AJAStringList AJACommandLineParser::GetKnownOptions | ( | ) |
Get the list of known options parsed by this args parser from the command line.
Definition at line 620 of file commandline.cpp.
std::string AJACommandLineParser::GetName | ( | ) | const |
Get the name of this command line args parser.
Definition at line 560 of file commandline.cpp.
AJAStringList AJACommandLineParser::GetUnknownOptions | ( | ) |
Get the list of unknown options parsed by this args parser from the command line.
Definition at line 637 of file commandline.cpp.
std::string AJACommandLineParser::GetUsageText | ( | ) | const |
Get the usage text string for this args parser.
Definition at line 584 of file commandline.cpp.
bool AJACommandLineParser::IsSet | ( | const std::string & | name | ) | const |
Tests if the specified arg was set on the command line.
[in] | name | The arg name. |
true
if the arg was set, otherwise false
. Definition at line 374 of file commandline.cpp.
void AJACommandLineParser::operator= | ( | const AJACommandLineParser & | other | ) |
Definition at line 165 of file commandline.cpp.
bool AJACommandLineParser::OptionByName | ( | const std::string & | name, |
AJACommandLineOption & | opt | ||
) | const |
Definition at line 223 of file commandline.cpp.
void AJACommandLineParser::ParseArgs | ( | const AJAStringList & | args | ) |
Parse a list of strings containing command line args.
[in] | desc | The list of arg strings. |
true
if the command line args were parsed successfully, otherwise false
. Definition at line 271 of file commandline.cpp.
void AJACommandLineParser::ParseArgs | ( | int | argc, |
char * | argv[] | ||
) |
Parse a list of strings containing command line args.
[in] | argc | The arg count. |
[in] | argv | The list of arg strings. |
Definition at line 362 of file commandline.cpp.
void AJACommandLineParser::ParseArgs | ( | int | argc, |
const char * | argv[] | ||
) |
Parse a list of strings containing command line args.
[in] | argc | The arg count. |
[in] | argv | The list of arg strings. |
Definition at line 350 of file commandline.cpp.
void AJACommandLineParser::Reset | ( | bool | clearAll = false | ) |
Definition at line 185 of file commandline.cpp.
void AJACommandLineParser::SetHelpText | ( | const std::string & | helpText | ) |
Set the help text string to print if help is invoked by the args parser.
[in] | name | The help text string. |
Definition at line 596 of file commandline.cpp.
void AJACommandLineParser::SetUsageText | ( | const std::string & | usageText | ) |
Set the usage text string to print if help is invoked by the args parser.
[in] | name | The usage text string. |
Definition at line 572 of file commandline.cpp.
AJAVariant AJACommandLineParser::Value | ( | const std::string & | name, |
size_t | index = 0 |
||
) | const |
Get a variant representing the value of the specified arg name.
[in] | name | The arg name. |
[in] | index | The index of the value to get. |
Definition at line 396 of file commandline.cpp.
AJAVariantList AJACommandLineParser::Values | ( | const std::string & | name | ) | const |
Get a list of variants representing the values of the specified arg name.
[in] | name | The arg name. |
Definition at line 401 of file commandline.cpp.
std::string AJACommandLineParser::ValueString | ( | const std::string & | name, |
size_t | index = 0 |
||
) | const |
Get the string value for the specified arg name.
[in] | name | The arg name. |
[in] | index | The index of value to get. |
Definition at line 414 of file commandline.cpp.
AJAStringList AJACommandLineParser::ValueStrings | ( | const std::string & | name | ) | const |
Get a list of string values for the specified arg name.
[in] | name | The arg name. |
Definition at line 435 of file commandline.cpp.