Public Types | Public Member Functions | Private Attributes
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
}

Public Member Functions

bool checkArgument (const std::string &value) const
 cmdline_option (const std::string &description)
int getArgumentFlags () const
std::string getConfigKey () const
std::string getDefaultValue () const
std::string getHelp () const
std::string getLong () const
std::string getShort () const
bool hasArgument () const
bool hasDefaultValue () const
bool isArgumentOptional () const
bool isMultiple () const
bool isRequired () const
 ~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 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

Definition at line 47 of file 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.

Definition at line 108 of file commandline.cc.


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)

Definition at line 138 of file commandline.cc.

Definition at line 123 of file commandline.cc.

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

Definition at line 111 of file commandline.cc.

Definition at line 128 of file commandline.cc.

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

Definition at line 119 of file commandline.cc.

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

Definition at line 117 of file commandline.cc.

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

Definition at line 118 of file commandline.cc.

Definition at line 124 of file commandline.cc.

Definition at line 127 of file commandline.cc.

Definition at line 125 of file commandline.cc.

Definition at line 110 of file commandline.cc.

Definition at line 121 of file commandline.cc.


Member Data Documentation

Definition at line 92 of file commandline.hh.

std::string utilmm::cmdline_option::m_config [private]

Definition at line 90 of file commandline.hh.

std::string utilmm::cmdline_option::m_default [private]

Definition at line 93 of file commandline.hh.

std::string utilmm::cmdline_option::m_help [private]

Definition at line 90 of file commandline.hh.

std::string utilmm::cmdline_option::m_long [private]

Definition at line 90 of file commandline.hh.

Definition at line 88 of file commandline.hh.

Definition at line 89 of file commandline.hh.

std::string utilmm::cmdline_option::m_short [private]

Definition at line 90 of file commandline.hh.


The documentation for this class was generated from the following files:


utilmm
Author(s): Sylvain Joyeux/sylvain.joyeux@m4x.org
autogenerated on Mon Oct 6 2014 03:17:01