Command-line option class for processing time strings. This class is allows the programmer to add command-line options to an application that can parse strings containing representations of time. The programmer must specify the format to be accepted. Refer to CommonTime::printf() for details on the formatting specifications.
Definition at line 61 of file CommandOptionWithTimeArg.hpp.
#include <CommandOptionWithTimeArg.hpp>
Public Member Functions | |
virtual std::string | checkArguments () |
Validate arguments passed using this option (and store them). More... | |
CommandOptionWithTimeArg (const char shOpt, const std::string &loOpt, const std::string &timeFormat, const std::string &desc, const bool required=false) | |
virtual std::string | getArgString () const |
std::vector< CommonTime > | getTime () const |
Return the times scanned in from the command line. More... | |
virtual | ~CommandOptionWithTimeArg () |
Destructor. More... | |
![]() | |
CommandOptionWithAnyArg (const char shOpt, const std::string &loOpt, const std::string &desc, const bool required=false) | |
Constructor. More... | |
virtual | ~CommandOptionWithAnyArg () |
Destructor. More... | |
![]() | |
CommandOptionWithArg (const CommandOptionType ot, const char shOpt, const std::string &loOpt, const std::string &desc, const bool required=false) | |
Constructor. More... | |
virtual | ~CommandOptionWithArg () |
Destructor. More... | |
![]() | |
CommandOption (const CommandOptionFlag of, const CommandOptionType ot, const char shOpt, const std::string &loOpt, const std::string &desc, const bool req=false, CommandOptionVec &optVectorList=defaultCommandOptionList) | |
std::ostream & | dumpValue (std::ostream &out) const |
Displays this->value to the stream out . More... | |
virtual unsigned long | getCount () const |
std::string | getDescription () const |
Returns a formatted string with the description of this option. More... | |
std::string | getFullOptionString () const |
virtual std::string | getOptionString () const |
unsigned long | getOrder (unsigned long idx=-1) const |
const std::vector< std::string > & | getValue () const |
void | setDescription (const std::string &desc) |
CommandOption & | setMaxCount (const unsigned long l) |
struct option | toGetoptLongOption () const |
Returns a struct option for use with getopt_long. More... | |
std::string | toGetoptShortOption () const |
Returns a string for use with getopt. More... | |
virtual | ~CommandOption () |
Destructor. More... | |
Protected Member Functions | |
CommandOptionWithTimeArg () | |
Default Constructor. More... | |
virtual std::string | getTimeSpec (std::vector< std::string >::size_type index) const |
Return the appropriate time scanning format for value[index]. More... | |
![]() | |
CommandOptionWithAnyArg () | |
Default Constructor. More... | |
![]() | |
CommandOptionWithArg () | |
Default Constructor. More... | |
![]() | |
CommandOption () | |
Default Constructor. More... | |
Protected Attributes | |
std::vector< CommonTime > | times |
Collection of times scanned in from the command line. More... | |
std::string | timeSpec |
Format used to scan times in. More... | |
![]() | |
unsigned long | count |
std::string | description |
The description for the help text. More... | |
std::string | longOpt |
The string for the long option (for example, "--foo"). More... | |
unsigned long | maxCount |
CommandOptionFlag | optFlag |
Flag for determining whether this option has an argument or not. More... | |
CommandOptionType | optType |
std::vector< unsigned long > | order |
The order in which this option was encountered on the command line. More... | |
CommandOptionParser * | parser |
bool | required |
Whether or not this is a required command line option. More... | |
char | shortOpt |
The character for the short option (for example, '-f'). More... | |
std::vector< std::string > | value |
Any arguments passed with this option get put in here. More... | |
Additional Inherited Members | |
![]() | |
enum | CommandOptionFlag { noArgument = 0, hasArgument = 1 } |
enum | CommandOptionType { trailingType, stdType, metaType } |
|
inline |
Constructor
shOpt | The one character command line option. Set to 0 if unused. |
loOpt | The long command option. Set to std::string() if unused. |
timeFormat | format for scanning argument into a CommonTime ( |
desc | A string describing what this option does. |
required | Set to true if this is a required option. |
Definition at line 74 of file CommandOptionWithTimeArg.hpp.
|
inlinevirtual |
Destructor.
Definition at line 84 of file CommandOptionWithTimeArg.hpp.
|
inlineprotected |
Default Constructor.
Definition at line 104 of file CommandOptionWithTimeArg.hpp.
|
virtual |
Validate arguments passed using this option (and store them).
Reimplemented from gnsstk::CommandOption.
Definition at line 52 of file CommandOptionWithTimeArg.cpp.
|
inlinevirtual |
Returns a string with the argument format (just "TIME", not scanning format).
Reimplemented from gnsstk::CommandOption.
Definition at line 88 of file CommandOptionWithTimeArg.hpp.
|
inline |
Return the times scanned in from the command line.
Definition at line 95 of file CommandOptionWithTimeArg.hpp.
|
inlineprotectedvirtual |
Return the appropriate time scanning format for value[index].
Reimplemented in gnsstk::CommandOptionWithSimpleTimeArg.
Definition at line 107 of file CommandOptionWithTimeArg.hpp.
|
protected |
Collection of times scanned in from the command line.
Definition at line 99 of file CommandOptionWithTimeArg.hpp.
|
protected |
Format used to scan times in.
Definition at line 101 of file CommandOptionWithTimeArg.hpp.