Classes | Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends

cmtk::CommandLine::Item Class Reference

Virtual base class for command line item. More...

#include <cmtkCommandLine.h>

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

List of all members.

Classes

class  Helper
 Helper class to avoid function template. More...

Public Types

typedef SmartPointer< ItemSmartPtr
 Smart pointer to this class.

Public Member Functions

 Item ()
 Constructor.
virtual ~Item ()
 Virtual destructor.
virtual ItemSetProperties (const long int properties)
 Set item properties.
virtual long int GetProperties () const
 Get item properties.
virtual ItemSetAttribute (const std::string &key, const std::string &value)
 Set an attribute.
virtual void Evaluate (const size_t argc, const char *argv[], size_t &index)=0
 Virtual function: evaluate switch or option.
virtual mxml_node_t * MakeXML (mxml_node_t *const parent) const =0
 Virtual function that returns an XML tree describing this option.
virtual std::string GetParamTypeString () const
 Virtual function returns a string that describes the parameter type associated with this option (derived classes only)
virtual std::ostringstream & PrintHelp (std::ostringstream &fmt) const
 Format additional help information.
virtual void PrintWiki () const
 Format additional help information.
virtual bool IsDefault () const
 Return true if and only if this item is the default for the associated action or variable.

Protected Member Functions

template<class T >
Convert (const char *str)
 Convert function.

Static Protected Member Functions

static long int ConvertStrToLong (const char *str)
 Safely convertstring argument to long integer.
static double ConvertStrToDouble (const char *str)
 Safely convert string argument to double.

Protected Attributes

long int m_Properties
 Item properties.
std::map< std::string,
std::string > 
m_Attributes
 Item attributes. These are free-form string key/value pairs.

Friends

class CommandLine
 Allow command line class full access.

Detailed Description

Virtual base class for command line item.

Definition at line 265 of file cmtkCommandLine.h.


Member Typedef Documentation

Smart pointer to this class.

Reimplemented in cmtk::CommandLine::NonOptionParameter, and cmtk::CommandLine::NonOptionParameterVector.

Definition at line 269 of file cmtkCommandLine.h.


Constructor & Destructor Documentation

cmtk::CommandLine::Item::Item (  ) [inline]

Constructor.

Definition at line 272 of file cmtkCommandLine.h.

virtual cmtk::CommandLine::Item::~Item (  ) [inline, virtual]

Virtual destructor.

Definition at line 275 of file cmtkCommandLine.h.


Member Function Documentation

double cmtk::CommandLine::Item::ConvertStrToDouble ( const char *  str ) [static, protected]

Safely convert string argument to double.

Definition at line 48 of file cmtkCommandLineItem.cxx.

long int cmtk::CommandLine::Item::ConvertStrToLong ( const char *  str ) [static, protected]

Safely convertstring argument to long integer.

Definition at line 35 of file cmtkCommandLineItem.cxx.

virtual void cmtk::CommandLine::Item::Evaluate ( const size_t  argc,
const char *  argv[],
size_t &  index 
) [pure virtual]
virtual std::string cmtk::CommandLine::Item::GetParamTypeString (  ) const [inline, virtual]
virtual long int cmtk::CommandLine::Item::GetProperties (  ) const [inline, virtual]

Get item properties.

Definition at line 285 of file cmtkCommandLine.h.

virtual bool cmtk::CommandLine::Item::IsDefault (  ) const [inline, virtual]

Return true if and only if this item is the default for the associated action or variable.

Reimplemented in cmtk::CommandLine::Switch< T >.

Definition at line 322 of file cmtkCommandLine.h.

virtual mxml_node_t* cmtk::CommandLine::Item::MakeXML ( mxml_node_t *const   parent ) const [pure virtual]
virtual std::ostringstream& cmtk::CommandLine::Item::PrintHelp ( std::ostringstream &  fmt ) const [inline, virtual]

Format additional help information.

Parameters:
fmtStream that the additional help information is formatted into

Reimplemented in cmtk::CommandLine::Switch< T >, cmtk::CommandLine::Option< T >, cmtk::CommandLine::NonOptionParameter, cmtk::CommandLine::NonOptionParameterVector, cmtk::CommandLine::Option< std::vector< std::string > >, and cmtk::CommandLine::Option< const char * >.

Definition at line 308 of file cmtkCommandLine.h.

virtual void cmtk::CommandLine::Item::PrintWiki (  ) const [inline, virtual]
virtual Item* cmtk::CommandLine::Item::SetAttribute ( const std::string &  key,
const std::string &  value 
) [inline, virtual]

Set an attribute.

Definition at line 291 of file cmtkCommandLine.h.

virtual Item* cmtk::CommandLine::Item::SetProperties ( const long int  properties ) [inline, virtual]

Set item properties.

Definition at line 278 of file cmtkCommandLine.h.


Friends And Related Function Documentation

friend class CommandLine [friend]

Allow command line class full access.

Definition at line 357 of file cmtkCommandLine.h.


Member Data Documentation

std::map<std::string, std::string> cmtk::CommandLine::Item::m_Attributes [protected]

Item attributes. These are free-form string key/value pairs.

Definition at line 332 of file cmtkCommandLine.h.

Referenced by cmtk::CommandLine::Item::Helper< T >::MakeXML().


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