CommandOptionWithTimeArg Class Reference
[Command-Line OptionsGPStk Time Group]

#include <CommandOptionWithTimeArg.hpp>

Inheritance diagram for CommandOptionWithTimeArg:

Inheritance graph
[legend]
Collaboration diagram for CommandOptionWithTimeArg:

Collaboration graph
[legend]
List of all members.

Detailed Description

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 DayTime::printf() for details on the formatting specifications.

Definition at line 69 of file CommandOptionWithTimeArg.hpp.

Public Member Functions

 CommandOptionWithTimeArg (const char shOpt, const std::string &loOpt, const std::string &timeFormat, const std::string &desc, const bool required=false)
 Constructor.
virtual ~CommandOptionWithTimeArg ()
 Destructor.
virtual std::string getArgString () const
 Returns a string with the argument format (just "TIME", not scanning format).
virtual std::string checkArguments ()
 Validate arguments passed using this option (and store them).
std::vector< DayTimegetTime () const
 Return the times scanned in from the command line.

Protected Member Functions

 CommandOptionWithTimeArg ()
 Default Constructor.
virtual std::string getTimeSpec (std::vector< std::string >::size_type index) const
 Return the appropriate time scanning format for value[index].

Protected Attributes

std::vector< DayTimetimes
 Collection of times scanned in from the command line.
std::string timeSpec
 Format used to scan times in.


Constructor & Destructor Documentation

CommandOptionWithTimeArg const char  shOpt,
const std::string &  loOpt,
const std::string &  timeFormat,
const std::string &  desc,
const bool  required = false
[inline]
 

Constructor.

Parameters:
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 DayTime (
See also:
DayTime::setToString() for details).
Parameters:
desc A string describing what this option does.
required Set to true if this is a required option.

Definition at line 82 of file CommandOptionWithTimeArg.hpp.

virtual ~CommandOptionWithTimeArg  )  [inline, virtual]
 

Destructor.

Definition at line 92 of file CommandOptionWithTimeArg.hpp.

CommandOptionWithTimeArg  )  [inline, protected]
 

Default Constructor.

Definition at line 112 of file CommandOptionWithTimeArg.hpp.


Member Function Documentation

string checkArguments  )  [virtual]
 

Validate arguments passed using this option (and store them).

Reimplemented from CommandOption.

Definition at line 58 of file CommandOptionWithTimeArg.cpp.

References CommandOptionWithTimeArg::getTimeSpec(), DayTime::setToString(), and CommandOptionWithTimeArg::times.

virtual std::string getArgString  )  const [inline, virtual]
 

Returns a string with the argument format (just "TIME", not scanning format).

Reimplemented from CommandOption.

Definition at line 96 of file CommandOptionWithTimeArg.hpp.

std::vector<DayTime> getTime  )  const [inline]
 

Return the times scanned in from the command line.

Definition at line 103 of file CommandOptionWithTimeArg.hpp.

virtual std::string getTimeSpec std::vector< std::string >::size_type  index  )  const [inline, protected, virtual]
 

Return the appropriate time scanning format for value[index].

Reimplemented in CommandOptionWithSimpleTimeArg.

Definition at line 115 of file CommandOptionWithTimeArg.hpp.

Referenced by CommandOptionWithTimeArg::checkArguments().


Member Data Documentation

std::vector<DayTime> times [protected]
 

Collection of times scanned in from the command line.

Definition at line 107 of file CommandOptionWithTimeArg.hpp.

Referenced by CommandOptionWithTimeArg::checkArguments().

std::string timeSpec [protected]
 

Format used to scan times in.

Definition at line 109 of file CommandOptionWithTimeArg.hpp.


The documentation for this class was generated from the following files:
Generated on Thu Feb 9 03:31:34 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1