#include <commandline.hh>
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 |
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.
Argument types Each option may have zero or one option the option is described using a or-ed int of this enum
Definition at line 47 of file commandline.hh.
utilmm::cmdline_option::cmdline_option | ( | const std::string & | description | ) |
Builds an option using the option description syntax as in command_line
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.
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 |
Definition at line 123 of file commandline.cc.
std::string utilmm::cmdline_option::getConfigKey | ( | ) | const |
Definition at line 111 of file commandline.cc.
std::string utilmm::cmdline_option::getDefaultValue | ( | ) | const |
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.
bool utilmm::cmdline_option::hasArgument | ( | ) | const |
Definition at line 124 of file commandline.cc.
bool utilmm::cmdline_option::hasDefaultValue | ( | ) | const |
Definition at line 127 of file commandline.cc.
bool utilmm::cmdline_option::isArgumentOptional | ( | ) | const |
Definition at line 125 of file commandline.cc.
bool utilmm::cmdline_option::isMultiple | ( | ) | const |
Definition at line 110 of file commandline.cc.
bool utilmm::cmdline_option::isRequired | ( | ) | const |
Definition at line 121 of file commandline.cc.
int utilmm::cmdline_option::m_argument_flags [private] |
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.
bool utilmm::cmdline_option::m_multiple [private] |
Definition at line 88 of file commandline.hh.
bool utilmm::cmdline_option::m_required [private] |
Definition at line 89 of file commandline.hh.
std::string utilmm::cmdline_option::m_short [private] |
Definition at line 90 of file commandline.hh.