Command line switch. More...
Public Member Functions | |
Switch (T *const field, const T value) | |
Constructor. | |
virtual | ~Switch () |
Virtual destructor. | |
virtual void | Evaluate (const size_t, const char *[], size_t &) |
Evaluate and set associated flag. | |
virtual mxml_node_t * | MakeXML (mxml_node_t *const parent) const |
Virtual function that returns an XML tree describing this option. | |
virtual std::ostringstream & | PrintHelp (std::ostringstream &fmt) const |
Format additional help information (e.g., default values). | |
virtual void | PrintWiki () const |
Format additional help information (e.g., default values). | |
virtual bool | IsDefault () const |
Return true if and only if this item is the default for the associated action or variable. | |
Private Attributes | |
T * | m_Field |
Pointer to field handled by this switch. | |
const T | m_Value |
Value to set field to when switch is encountered. |
Command line switch.
Definition at line 363 of file cmtkCommandLine.h.
cmtk::CommandLine::Switch< T >::Switch | ( | T *const | field, |
const T | value | ||
) | [inline] |
Constructor.
Definition at line 369 of file cmtkCommandLine.h.
virtual cmtk::CommandLine::Switch< T >::~Switch | ( | ) | [inline, virtual] |
Virtual destructor.
Definition at line 376 of file cmtkCommandLine.h.
virtual void cmtk::CommandLine::Switch< T >::Evaluate | ( | const | size_t, |
const char * | [], | ||
size_t & | |||
) | [inline, virtual] |
Evaluate and set associated flag.
Implements cmtk::CommandLine::Item.
Definition at line 379 of file cmtkCommandLine.h.
virtual bool cmtk::CommandLine::Switch< T >::IsDefault | ( | ) | const [inline, virtual] |
Return true if and only if this item is the default for the associated action or variable.
Reimplemented from cmtk::CommandLine::Item.
Definition at line 411 of file cmtkCommandLine.h.
virtual mxml_node_t* cmtk::CommandLine::Switch< T >::MakeXML | ( | mxml_node_t *const | parent ) | const [inline, virtual] |
Virtual function that returns an XML tree describing this option.
Implements cmtk::CommandLine::Item.
Definition at line 385 of file cmtkCommandLine.h.
References NULL.
virtual std::ostringstream& cmtk::CommandLine::Switch< T >::PrintHelp | ( | std::ostringstream & | fmt ) | const [inline, virtual] |
Format additional help information (e.g., default values).
fmt | Stream that the additional help information is formatted into |
Reimplemented from cmtk::CommandLine::Item.
Definition at line 395 of file cmtkCommandLine.h.
virtual void cmtk::CommandLine::Switch< T >::PrintWiki | ( | ) | const [inline, virtual] |
Format additional help information (e.g., default values).
Reimplemented from cmtk::CommandLine::Item.
Definition at line 404 of file cmtkCommandLine.h.
References cmtk::StdOut.
T* cmtk::CommandLine::Switch< T >::m_Field [private] |
Pointer to field handled by this switch.
Definition at line 418 of file cmtkCommandLine.h.
const T cmtk::CommandLine::Switch< T >::m_Value [private] |
Value to set field to when switch is encountered.
Definition at line 421 of file cmtkCommandLine.h.