AJA NTV2 SDK  17.6.0.2675
NTV2 SDK 17.6.0.2675
AJACommandLineOption Class Reference

#include <commandline.h>

Public Member Functions

 AJACommandLineOption ()
 
 AJACommandLineOption (const std::string &name, const std::string &desc="", const std::string &defaultValue="")
 
 AJACommandLineOption (const AJAStringList &names, const std::string &desc="", const std::string &defaultValue="")
 
virtual ~AJACommandLineOption ()
 
bool AddName (const std::string &name)
 
AJAStringList Names () const
 
bool HaveName (const std::string &name) const
 
std::string Desc () const
 
void SetDesc (const std::string &desc)
 
std::string ExtraDesc () const
 
void SetExtraDesc (const std::string &desc)
 
void SetDefaultValue (const std::string &value)
 
std::string DefaultValue () const
 
void AddValue (const std::string &value)
 
std::string Value (size_t index=0) const
 
AJAStringList Values () const
 
void Reset ()
 
bool IsSet () const
 
void MarkSet (bool isSet=true)
 

Detailed Description

Class that represents a command-line option.

Definition at line 29 of file commandline.h.

Constructor & Destructor Documentation

◆ AJACommandLineOption() [1/3]

AJACommandLineOption::AJACommandLineOption ( )

Definition at line 18 of file commandline.cpp.

◆ AJACommandLineOption() [2/3]

AJACommandLineOption::AJACommandLineOption ( const std::string &  name,
const std::string &  desc = "",
const std::string &  defaultValue = "" 
)

Definition at line 27 of file commandline.cpp.

◆ AJACommandLineOption() [3/3]

AJACommandLineOption::AJACommandLineOption ( const AJAStringList names,
const std::string &  desc = "",
const std::string &  defaultValue = "" 
)

Definition at line 40 of file commandline.cpp.

◆ ~AJACommandLineOption()

AJACommandLineOption::~AJACommandLineOption ( )
virtual

Definition at line 55 of file commandline.cpp.

Member Function Documentation

◆ AddName()

bool AJACommandLineOption::AddName ( const std::string &  name)

Add an arg name to this AJACommandLineOption.

Parameters
[in]nameThe arg name to add.

Definition at line 59 of file commandline.cpp.

◆ AddValue()

void AJACommandLineOption::AddValue ( const std::string &  value)

Add a value string to this AJACommandLineOption.

Parameters
[in]valueThe value string.

Definition at line 122 of file commandline.cpp.

◆ DefaultValue()

std::string AJACommandLineOption::DefaultValue ( ) const

Get the default value string for this AJACommandLineOption.

Returns
The default value string.

Definition at line 117 of file commandline.cpp.

◆ Desc()

std::string AJACommandLineOption::Desc ( ) const

Get the description string for this AJACommandLineOption.

Returns
The description string.

Definition at line 91 of file commandline.cpp.

◆ ExtraDesc()

std::string AJACommandLineOption::ExtraDesc ( ) const

Get the extra description string for this AJACommandLineOption.

Returns
The extra description string.

Definition at line 101 of file commandline.cpp.

◆ HaveName()

bool AJACommandLineOption::HaveName ( const std::string &  name) const

Determine if this AJACommandLineOption contains the specified name.

Parameters
[in]nameThe option name to check.
Returns
Returns true if the option name is found, otherwise false.

Definition at line 80 of file commandline.cpp.

◆ IsSet()

bool AJACommandLineOption::IsSet ( ) const

Get all value strings from this AJACommandLineOption.

Returns
Returns true if the option is set, otherwise return false.

Definition at line 146 of file commandline.cpp.

◆ MarkSet()

void AJACommandLineOption::MarkSet ( bool  isSet = true)

Mark this AJACommandLineOption as "set", or enabled. Typically used by an AJACommandLineParser instance to flag specific options as having been set at the command-line, at the time the arguments are parsed.

Parameters
[in]isSetA boolean representing the enabled state of the option.

Definition at line 150 of file commandline.cpp.

◆ Names()

AJAStringList AJACommandLineOption::Names ( ) const

Get list of arg names attached to this AJACommandLineOption.

Returns
The list of names.

Definition at line 75 of file commandline.cpp.

◆ Reset()

void AJACommandLineOption::Reset ( )

Reset values and "set" state of this AJACommandLineOption.

Definition at line 140 of file commandline.cpp.

◆ SetDefaultValue()

void AJACommandLineOption::SetDefaultValue ( const std::string &  value)

Set the default value string for this AJACommandLineOption.

Parameters
[in]valueThe default value string.

Definition at line 112 of file commandline.cpp.

◆ SetDesc()

void AJACommandLineOption::SetDesc ( const std::string &  desc)

Set the description string for this AJACommandLineOption.

Parameters
[in]descThe description string.

Definition at line 96 of file commandline.cpp.

◆ SetExtraDesc()

void AJACommandLineOption::SetExtraDesc ( const std::string &  desc)

Set the extra description string for this AJACommandLineOption.

Parameters
[in]descThe extra description string.

Definition at line 106 of file commandline.cpp.

◆ Value()

std::string AJACommandLineOption::Value ( size_t  index = 0) const

Get value string at the specified index from this AJACommandLineOption.

Parameters
[in]indexThe index of the value to retrieve.
Returns
The default value string.

Definition at line 127 of file commandline.cpp.

◆ Values()

AJAStringList AJACommandLineOption::Values ( ) const

Get all value strings from this AJACommandLineOption.

Returns
The AJAStringList of all value strings.

Definition at line 135 of file commandline.cpp.


The documentation for this class was generated from the following files: