CommandOptionWithPositionArg Class Reference
[Command-Line Options]

#include <CommandOptionWithPositionArg.hpp>

Inheritance diagram for CommandOptionWithPositionArg:

Inheritance graph
[legend]
Collaboration diagram for CommandOptionWithPositionArg:

Collaboration graph
[legend]
List of all members.

Detailed Description

Command-line option class for processing position strings. This class allows the programmer to add command-line options to an application that can parse strings containing representations of position. The programmer must specify the format to be accepted. Refer to Position::printf() for details on the formatting specifications.

Definition at line 70 of file CommandOptionWithPositionArg.hpp.

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

std::vector< Positionpositions
 Collection of positions scanned in from the command line.
std::string posSpec
 Format used to scan positions in.


Constructor & Destructor Documentation

CommandOptionWithPositionArg const char  shOpt,
const std::string &  loOpt,
const std::string &  posFormat,
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.
posFormat format for scanning argument into a Position (
See also:
Position::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 83 of file CommandOptionWithPositionArg.hpp.

virtual ~CommandOptionWithPositionArg  )  [inline, virtual]
 

Destructor.

Definition at line 93 of file CommandOptionWithPositionArg.hpp.

CommandOptionWithPositionArg  )  [inline, protected]
 

Default Constructor.

Definition at line 117 of file CommandOptionWithPositionArg.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 CommandOptionWithPositionArg.cpp.

References CommandOptionWithPositionArg::getPositionSpec(), CommandOptionWithPositionArg::positions, and Position::setToString().

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

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

Reimplemented from CommandOption.

Definition at line 99 of file CommandOptionWithPositionArg.hpp.

std::vector<Position> getPosition  )  const [inline]
 

Return the positions scanned in from the command line.

Definition at line 106 of file CommandOptionWithPositionArg.hpp.

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

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

Definition at line 122 of file CommandOptionWithPositionArg.hpp.

Referenced by CommandOptionWithPositionArg::checkArguments().


Member Data Documentation

std::vector<Position> positions [protected]
 

Collection of positions scanned in from the command line.

Definition at line 111 of file CommandOptionWithPositionArg.hpp.

Referenced by CommandOptionWithPositionArg::checkArguments().

std::string posSpec [protected]
 

Format used to scan positions in.

Definition at line 114 of file CommandOptionWithPositionArg.hpp.


The documentation for this class was generated from the following files:
Generated on Thu May 23 03:31:46 2013 for GPS ToolKit Software Library by  doxygen 1.3.9.1