Local class that connects command line options with enum group evaluators. More...
#include <cmtkCommandLine.h>
Public Types | |
typedef KeyToAction | Superclass |
Superclass. | |
typedef SmartPointer < KeyToActionEnum > | SmartPtr |
Smart pointer. | |
Public Member Functions | |
KeyToActionEnum (const Key &key, EnumGroupBase::SmartPtr keyToActionEnum, const std::string &comment) | |
Constructor for enumeration parameter group. | |
virtual | ~KeyToActionEnum () |
Virtual destructor. | |
bool | MatchAndExecute (const std::string &key, const size_t argc, const char *argv[], size_t &index) |
Test long key from command line and execute if match. | |
bool | MatchAndExecute (const char keyChar, const size_t argc, const char *argv[], size_t &index) |
Test short key from command line and execute if match. | |
virtual mxml_node_t * | MakeXML (mxml_node_t *const parent) const |
Returns an XML tree describing this key and action. | |
virtual void | PrintHelp (const size_t globalIndent=0) const |
Print help for this item. | |
virtual void | PrintWikiWithPrefix (const std::string &prefix="") const |
Print help for this item in Wiki markup. | |
Private Attributes | |
EnumGroupBase::SmartPtr | m_EnumGroup |
For enum parameter group, list of subkeys and action. | |
Friends | |
class | EnumGroupBase |
Give enum group class full access. |
Local class that connects command line options with enum group evaluators.
Definition at line 874 of file cmtkCommandLine.h.
Smart pointer.
Reimplemented from cmtk::CommandLine::KeyToAction.
Definition at line 883 of file cmtkCommandLine.h.
Superclass.
Definition at line 880 of file cmtkCommandLine.h.
cmtk::CommandLine::KeyToActionEnum::KeyToActionEnum | ( | const Key & | key, |
EnumGroupBase::SmartPtr | keyToActionEnum, | ||
const std::string & | comment | ||
) | [inline] |
Constructor for enumeration parameter group.
An enumeration parameter group is a group of parameters that all modify the same variable by setting it to different values. There is one command line parameter (i.e., key/action pair) per value, plus a group parameter, which sets the variable based on the name of one of the supported values.
key | Key: long and/or short command line option for this action. |
keyToActionEnum | The definition of the enumeration keys and values. |
comment | Command line help comment for this action. |
Definition at line 891 of file cmtkCommandLine.h.
virtual cmtk::CommandLine::KeyToActionEnum::~KeyToActionEnum | ( | ) | [inline, virtual] |
Virtual destructor.
Definition at line 899 of file cmtkCommandLine.h.
mxml_node_t * cmtk::CommandLine::KeyToActionEnum::MakeXML | ( | mxml_node_t *const | parent ) | const [virtual] |
Returns an XML tree describing this key and action.
parent | Parent in the XML tree for the new node. |
Reimplemented from cmtk::CommandLine::KeyToAction.
Definition at line 91 of file cmtkCommandLineKeyToActionEnum.cxx.
References NULL.
bool cmtk::CommandLine::KeyToActionEnum::MatchAndExecute | ( | const char | keyChar, |
const size_t | argc, | ||
const char * | argv[], | ||
size_t & | index | ||
) | [virtual] |
Test short key from command line and execute if match.
keyChar | Key (long option) from the command line. |
argc | Total number of command line arguments. |
argv | Command line argument list. |
index | Current index in command line list |
Implements cmtk::CommandLine::KeyToAction.
Definition at line 149 of file cmtkCommandLineKeyToActionEnum.cxx.
bool cmtk::CommandLine::KeyToActionEnum::MatchAndExecute | ( | const std::string & | key, |
const size_t | argc, | ||
const char * | argv[], | ||
size_t & | index | ||
) | [virtual] |
Test long key from command line and execute if match.
key | Key (long option) from the command line. |
argc | Total number of command line arguments. |
argv | Command line argument list. |
index | Current index in command line list |
Implements cmtk::CommandLine::KeyToAction.
Definition at line 113 of file cmtkCommandLineKeyToActionEnum.cxx.
void cmtk::CommandLine::KeyToActionEnum::PrintHelp | ( | const size_t | globalIndent = 0 ) |
const [virtual] |
Print help for this item.
Implements cmtk::CommandLine::KeyToAction.
Definition at line 36 of file cmtkCommandLineKeyToActionEnum.cxx.
References cmtk::Console::FormatText(), cmtk::Console::GetLineWidth(), cmtk::CommandLine::HelpTextIndent, and cmtk::StdErr.
void cmtk::CommandLine::KeyToActionEnum::PrintWikiWithPrefix | ( | const std::string & | prefix = "" ) |
const [virtual] |
Print help for this item in Wiki markup.
Reimplemented from cmtk::CommandLine::KeyToAction.
Definition at line 65 of file cmtkCommandLineKeyToActionEnum.cxx.
References cmtk::StdOut.
friend class EnumGroupBase [friend] |
Give enum group class full access.
Definition at line 930 of file cmtkCommandLine.h.
For enum parameter group, list of subkeys and action.
Definition at line 927 of file cmtkCommandLine.h.