Local class that connects command line options with single action evaluators. More...
#include <cmtkCommandLine.h>


Public Types | |
| typedef KeyToAction | Superclass |
| Superclass. | |
| typedef SmartPointer < KeyToActionSingle > | SmartPtr |
| Smart pointer. | |
Public Member Functions | |
| KeyToActionSingle (const Key &key, Item::SmartPtr action, const std::string &comment) | |
| Constructor. | |
| virtual | ~KeyToActionSingle () |
| 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 wiki help for this item. | |
| virtual std::string | GetActionTypeInfo () const |
| Get type info for action parameter (if any). | |
Public Attributes | |
| Item::SmartPtr | m_Action |
| Action for simple key-action correspondence.. | |
Local class that connects command line options with single action evaluators.
Definition at line 794 of file cmtkCommandLine.h.
Smart pointer.
Reimplemented from cmtk::CommandLine::KeyToAction.
Definition at line 803 of file cmtkCommandLine.h.
Superclass.
Definition at line 800 of file cmtkCommandLine.h.
| cmtk::CommandLine::KeyToActionSingle::KeyToActionSingle | ( | const Key & | key, |
| Item::SmartPtr | action, | ||
| const std::string & | comment | ||
| ) | [inline] |
Constructor.
| key | Key: long and/or short command line option for this action. |
| action | The actual action (option, switch, callback, etc.) |
Definition at line 806 of file cmtkCommandLine.h.
| virtual cmtk::CommandLine::KeyToActionSingle::~KeyToActionSingle | ( | ) | [inline, virtual] |
Virtual destructor.
Definition at line 814 of file cmtkCommandLine.h.
| virtual std::string cmtk::CommandLine::KeyToActionSingle::GetActionTypeInfo | ( | ) | const [inline, virtual] |
Get type info for action parameter (if any).
Reimplemented from cmtk::CommandLine::KeyToAction.
Definition at line 841 of file cmtkCommandLine.h.
| mxml_node_t * cmtk::CommandLine::KeyToActionSingle::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 36 of file cmtkCommandLineKeyToActionSingle.cxx.
References cmtk::CommandLine::m_Properties, NULL, and cmtk::CommandLine::PROPS_NOXML.
| bool cmtk::CommandLine::KeyToActionSingle::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 80 of file cmtkCommandLineKeyToActionSingle.cxx.
| bool cmtk::CommandLine::KeyToActionSingle::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 68 of file cmtkCommandLineKeyToActionSingle.cxx.
| void cmtk::CommandLine::KeyToActionSingle::PrintHelp | ( | const size_t | globalIndent = 0 ) |
const [virtual] |
Print help for this item.
Implements cmtk::CommandLine::KeyToAction.
Definition at line 47 of file cmtkCommandLineKeyToActionSingle.cxx.
References cmtk::Console::FormatText(), cmtk::Console::GetLineWidth(), cmtk::CommandLine::HelpTextIndent, and cmtk::StdErr.
| void cmtk::CommandLine::KeyToActionSingle::PrintWikiWithPrefix | ( | const std::string & | prefix = "" ) |
const [virtual] |
Print wiki help for this item.
Reimplemented from cmtk::CommandLine::KeyToAction.
Definition at line 58 of file cmtkCommandLineKeyToActionSingle.cxx.
References cmtk::StdOut.
Action for simple key-action correspondence..
Definition at line 847 of file cmtkCommandLine.h.
1.7.2