CommandOptionDependent Class Reference
[Command-Line Options]

#include <CommandOption.hpp>

Inheritance diagram for CommandOptionDependent:

Inheritance graph
[legend]
Collaboration diagram for CommandOptionDependent:

Collaboration graph
[legend]
List of all members.

Detailed Description

This is a special "command option" which is really a meta-option to make sure that a required option is set where the requirement is based on another option (that is, if you specify one, you must have specified another).

Warning:
There's nothing to prevent you from using other meta options as requirements, but the behavior if you try this is undefined.

Definition at line 540 of file CommandOption.hpp.

Public Member Functions

 CommandOptionDependent (const CommandOption *parent, const CommandOption *child)
 CommandOptionDependent contructor.
virtual ~CommandOptionDependent ()
 Destructor.
virtual std::string checkArguments ()
 If you specified a format for the arguments (for example, digit or string), this function checks them to see if they match.

Protected Member Functions

 CommandOptionDependent ()
 Default Constructor.

Protected Attributes

const CommandOptionrequiree
const CommandOptionrequirer


Constructor & Destructor Documentation

CommandOptionDependent const CommandOption parent,
const CommandOption child
[inline]
 

CommandOptionDependent contructor.

This sets the CommandOptionType for this object to metaType. During command line option validation, if child is set, parent is checked to make sure it is also set.

Parameters:
parent Command option that must be used if...
child ...is used.

Definition at line 552 of file CommandOption.hpp.

virtual ~CommandOptionDependent  )  [inline, virtual]
 

Destructor.

Definition at line 559 of file CommandOption.hpp.

CommandOptionDependent  )  [inline, protected]
 

Default Constructor.

Definition at line 565 of file CommandOption.hpp.


Member Function Documentation

string checkArguments  )  [virtual]
 

If you specified a format for the arguments (for example, digit or string), this function checks them to see if they match.

If they don't, an error string is returned. If they do, an empty string is returned.

Parameters:
optVec complete set of processed command line options being processed (used by some option types).

Reimplemented from CommandOption.

Definition at line 341 of file CommandOption.cpp.

References CommandOption::getCount(), CommandOption::getOptionString(), CommandOptionDependent::requiree, and CommandOptionDependent::requirer.


Member Data Documentation

const CommandOption* requiree [protected]
 

Definition at line 567 of file CommandOption.hpp.

Referenced by CommandOptionDependent::checkArguments().

const CommandOption * requirer [protected]
 

Definition at line 567 of file CommandOption.hpp.

Referenced by CommandOptionDependent::checkArguments().


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