CASM
1.1.0
A Clusters Approach to Statistical Mechanics
|
#include <Complete.hh>
A typical casm command takes 3 types of parameters: Option: Things like "super", "enum", "monte", etc Suboption: Anything that starts with "--" or "-", such as "--max" or "-z" Argument: The argument you pass to the suboption, such as an integer or filename
The Suboption class consists of a string to identify the –long option, a character to identify the -s(hort) version, and the type of arguments that are expected.
Definition at line 37 of file Complete.hh.
Public Types | |
typedef ArgHandler::ARG_TYPE | ARG_TYPE |
Public Member Functions | |
Suboption (const std::string &init_longname, std::string init_short, ARG_TYPE init_expected_types) | |
Explicit construction. Be sure to include "--" and '-' in the tags. More... | |
Suboption (const po::option_description &init_boost_option) | |
Construct with boost objects. More... | |
std::string | long_tag () const |
Return long name in string format. More... | |
std::string | short_tag () const |
Return short name as char. More... | |
bool | matches (const std::string &test_tag) const |
ARG_TYPE | argument_type () const |
Return the expected types of arguments that follow *this. More... | |
Private Member Functions | |
void | _sanity_throw () const |
Make sure values make sense. More... | |
Private Attributes | |
const std::string | m_long |
–long identifier (includes leading "--") More... | |
const std::string | m_short |
-s(hort) identifyer (includes leading '-') More... | |
const ARG_TYPE | m_expected_arg |
Type of arguments expected. More... | |
Definition at line 39 of file Complete.hh.
CASM::Completer::Suboption::Suboption | ( | const std::string & | init_longname, |
std::string | init_short, | ||
ARG_TYPE | init_expected_types | ||
) |
Explicit construction. Be sure to include "--" and '-' in the tags.
Definition at line 48 of file Complete.cc.
CASM::Completer::Suboption::Suboption | ( | const po::option_description & | init_boost_option | ) |
Construct with boost objects.
Definition at line 56 of file Complete.cc.
|
private |
Make sure values make sense.
Definition at line 63 of file Complete.cc.
ARG_TYPE CASM::Completer::Suboption::argument_type | ( | ) | const |
Return the expected types of arguments that follow *this.
Definition at line 94 of file Complete.cc.
std::string CASM::Completer::Suboption::long_tag | ( | ) | const |
Return long name in string format.
Definition at line 76 of file Complete.cc.
bool CASM::Completer::Suboption::matches | ( | const std::string & | test_tag | ) | const |
See if a provided string matches either the –long or -s(hort) tags. Expects leading '-' characters.
Definition at line 80 of file Complete.cc.
std::string CASM::Completer::Suboption::short_tag | ( | ) | const |
Return short name as char.
Definition at line 78 of file Complete.cc.
|
private |
Type of arguments expected.
Definition at line 69 of file Complete.hh.
|
private |
–long identifier (includes leading "--")
Definition at line 63 of file Complete.hh.
|
private |
-s(hort) identifyer (includes leading '-')
Definition at line 66 of file Complete.hh.