utilmm::cmdline_option Class Reference

#include <commandline.hh>

List of all members.

Public Types

enum  ArgumentType {
  None = 0, Optional = 1, IntArgument = 2, BoolArgument = 4,
  StringArgument = 8, DefaultValue = 16, None = 0, Optional = 1,
  IntArgument = 2, BoolArgument = 4, StringArgument = 8, DefaultValue = 16
}
enum  ArgumentType {
  None = 0, Optional = 1, IntArgument = 2, BoolArgument = 4,
  StringArgument = 8, DefaultValue = 16, None = 0, Optional = 1,
  IntArgument = 2, BoolArgument = 4, StringArgument = 8, DefaultValue = 16
}

Public Member Functions

bool checkArgument (const std::string &value) const
bool checkArgument (const std::string &value) const
 cmdline_option (const std::string &description)
 cmdline_option (const std::string &description)
int getArgumentFlags () const
int getArgumentFlags () const
std::string getConfigKey () const
std::string getConfigKey () const
std::string getDefaultValue () const
std::string getDefaultValue () const
std::string getHelp () const
std::string getHelp () const
std::string getLong () const
std::string getLong () const
std::string getShort () const
std::string getShort () const
bool hasArgument () const
bool hasArgument () const
bool hasDefaultValue () const
bool hasDefaultValue () const
bool isArgumentOptional () const
bool isArgumentOptional () const
bool isMultiple () const
bool isMultiple () const
bool isRequired () const
bool isRequired () const
 ~cmdline_option ()
 ~cmdline_option ()

Private Attributes

int m_argument_flags
std::string m_config
std::string m_default
std::string m_help
std::string m_long
bool m_multiple
bool m_required
std::string m_short

Detailed Description

Each option description is parsed and transformed in a cmdline_option object. The command_line code then uses these objects

Definition at line 39 of file install/include/utilmm/configfile/commandline.hh.


Member Enumeration Documentation

Argument types Each option may have zero or one option the option is described using a or-ed int of this enum

Enumerator:
None 
Optional 

no arguments

IntArgument 

the argument may be ommitted

BoolArgument 

the argument is an integer

StringArgument 

the argument is a boolean, that is 0, 1, 'false' or 'true'

DefaultValue 

the argument is a string

None 
Optional 

no arguments

IntArgument 

the argument may be ommitted

BoolArgument 

the argument is an integer

StringArgument 

the argument is a boolean, that is 0, 1, 'false' or 'true'

DefaultValue 

the argument is a string

Definition at line 47 of file utilmm/configfile/commandline.hh.

Argument types Each option may have zero or one option the option is described using a or-ed int of this enum

Enumerator:
None 
Optional 

no arguments

IntArgument 

the argument may be ommitted

BoolArgument 

the argument is an integer

StringArgument 

the argument is a boolean, that is 0, 1, 'false' or 'true'

DefaultValue 

the argument is a string

None 
Optional 

no arguments

IntArgument 

the argument may be ommitted

BoolArgument 

the argument is an integer

StringArgument 

the argument is a boolean, that is 0, 1, 'false' or 'true'

DefaultValue 

the argument is a string

Definition at line 47 of file install/include/utilmm/configfile/commandline.hh.


Constructor & Destructor Documentation

utilmm::cmdline_option::cmdline_option ( const std::string &  description  ) 

Builds an option using the option description syntax as in command_line

  • option the option description, see the command_line for its syntax If option is not a valid description string, the constructor returns and isValid() will return false

Definition at line 31 of file commandline.cc.

utilmm::cmdline_option::~cmdline_option (  ) 

Definition at line 108 of file commandline.cc.

utilmm::cmdline_option::cmdline_option ( const std::string &  description  ) 

Builds an option using the option description syntax as in command_line

  • option the option description, see the command_line for its syntax If option is not a valid description string, the constructor returns and isValid() will return false
utilmm::cmdline_option::~cmdline_option (  ) 

Member Function Documentation

bool utilmm::cmdline_option::checkArgument ( const std::string &  value  )  const

Checks that value is a valid string according to the argument type (int, bool or string)

bool utilmm::cmdline_option::checkArgument ( const std::string &  value  )  const

Checks that value is a valid string according to the argument type (int, bool or string)

Definition at line 138 of file commandline.cc.

int utilmm::cmdline_option::getArgumentFlags (  )  const
int utilmm::cmdline_option::getArgumentFlags (  )  const

Definition at line 123 of file commandline.cc.

std::string utilmm::cmdline_option::getConfigKey (  )  const
std::string utilmm::cmdline_option::getConfigKey (  )  const

Definition at line 111 of file commandline.cc.

std::string utilmm::cmdline_option::getDefaultValue (  )  const
std::string utilmm::cmdline_option::getDefaultValue (  )  const

Definition at line 128 of file commandline.cc.

std::string utilmm::cmdline_option::getHelp (  )  const
std::string utilmm::cmdline_option::getHelp (  )  const

Definition at line 119 of file commandline.cc.

std::string utilmm::cmdline_option::getLong (  )  const
std::string utilmm::cmdline_option::getLong (  )  const

Definition at line 117 of file commandline.cc.

std::string utilmm::cmdline_option::getShort (  )  const
std::string utilmm::cmdline_option::getShort (  )  const

Definition at line 118 of file commandline.cc.

bool utilmm::cmdline_option::hasArgument (  )  const
bool utilmm::cmdline_option::hasArgument (  )  const

Definition at line 124 of file commandline.cc.

bool utilmm::cmdline_option::hasDefaultValue (  )  const
bool utilmm::cmdline_option::hasDefaultValue (  )  const

Definition at line 127 of file commandline.cc.

bool utilmm::cmdline_option::isArgumentOptional (  )  const
bool utilmm::cmdline_option::isArgumentOptional (  )  const

Definition at line 125 of file commandline.cc.

bool utilmm::cmdline_option::isMultiple (  )  const
bool utilmm::cmdline_option::isMultiple (  )  const

Definition at line 110 of file commandline.cc.

bool utilmm::cmdline_option::isRequired (  )  const
bool utilmm::cmdline_option::isRequired (  )  const

Definition at line 121 of file commandline.cc.


Member Data Documentation

std::string utilmm::cmdline_option::m_config [private]
std::string utilmm::cmdline_option::m_default [private]
std::string utilmm::cmdline_option::m_help [private]
std::string utilmm::cmdline_option::m_long [private]
std::string utilmm::cmdline_option::m_short [private]

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


utilmm
Author(s): Sylvain Joyeux/sylvain.joyeux@m4x.org
autogenerated on Fri Jan 11 10:07:42 2013