Public Types | Public Member Functions | Public Attributes

cmtk::CommandLine::KeyToActionSingle Class Reference

Local class that connects command line options with single action evaluators. More...

#include <cmtkCommandLine.h>

Inheritance diagram for cmtk::CommandLine::KeyToActionSingle:
Inheritance graph
[legend]
Collaboration diagram for cmtk::CommandLine::KeyToActionSingle:
Collaboration graph
[legend]

List of all members.

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..

Detailed Description

Local class that connects command line options with single action evaluators.

Definition at line 794 of file cmtkCommandLine.h.


Member Typedef Documentation

Smart pointer.

Reimplemented from cmtk::CommandLine::KeyToAction.

Definition at line 803 of file cmtkCommandLine.h.

Superclass.

Definition at line 800 of file cmtkCommandLine.h.


Constructor & Destructor Documentation

cmtk::CommandLine::KeyToActionSingle::KeyToActionSingle ( const Key key,
Item::SmartPtr  action,
const std::string &  comment 
) [inline]

Constructor.

Parameters:
keyKey: long and/or short command line option for this action.
actionThe 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.


Member Function Documentation

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.

Parameters:
parentParent 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.

Parameters:
keyCharKey (long option) from the command line.
argcTotal number of command line arguments.
argvCommand line argument list.
indexCurrent 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.

Parameters:
keyKey (long option) from the command line.
argcTotal number of command line arguments.
argvCommand line argument list.
indexCurrent 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]
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.


Member Data Documentation

Action for simple key-action correspondence..

Definition at line 847 of file cmtkCommandLine.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines