MADNESS 0.10.1
|
very simple command line parser More...
#include <commandlineparser.h>
Public Member Functions | |
commandlineparser () | |
commandlineparser (int argc, char **argv) | |
std::string | check_for_input_file (std::string line) |
special option: the input file has no hyphens in front and is just a value | |
bool | key_exists (std::string key) const |
void | print_map () const |
void | set_defaults () |
set default values from the command line | |
void | set_keyval (const std::string key, const std::string value) |
std::string | value (const std::string key) const |
Static Public Member Functions | |
static std::string | base_name (std::string const &path, std::string const &delims="/") |
static std::string | remove_blanks (const std::string arg) |
remove all blanks | |
static std::string | remove_extension (std::string const &filename) |
static std::string | remove_first_equal (const std::string arg) |
static std::string | remove_front_hyphens (const std::string arg) |
static std::vector< std::string > | split (std::string s, const std::string delimiter) |
split a string s into a vector of strings, using delimiter | |
static std::string | tolower (std::string s) |
make lower case | |
static std::string | trim_blanks (const std::string arg) |
remove blanks at the beginning and the end only | |
Public Attributes | |
std::map< std::string, std::string > | keyval |
very simple command line parser
parser reads out key/value pairs from the command line of the from –key=val or –key currently no error handling, feel free to add.
|
inline |
References set_defaults().
|
inline |
References a, check_for_input_file(), remove_first_equal(), remove_front_hyphens(), set_defaults(), and set_keyval().
|
inlinestatic |
Referenced by madness::CalculationParameters::set_derived_values().
|
inline |
special option: the input file has no hyphens in front and is just a value
References split().
Referenced by commandlineparser().
|
inline |
References keyval, and tolower().
Referenced by madness::CalculationParameters::CalculationParameters(), main(), main(), madness::QCCalculationParametersBase::read_commandline_options(), madness::QCCalculationParametersBase::read_input_and_commandline_options(), madness::Molecule::GeometryParameters::set_derived_values(), madness::Molecule::GeometryParameters::set_global_convenience_options(), and value().
|
inline |
|
inlinestatic |
remove all blanks
References madness::arg().
|
inlinestatic |
References madness::filename, and p().
Referenced by madness::CalculationParameters::set_derived_values().
|
inlinestatic |
References madness::arg().
Referenced by commandlineparser().
|
inlinestatic |
References madness::arg().
Referenced by commandlineparser().
|
inline |
set default values from the command line
References keyval.
Referenced by commandlineparser(), and commandlineparser().
|
inline |
References keyval, tolower(), trim_blanks(), and value().
Referenced by commandlineparser(), dnuclear_anchor_test(), initialize_calc_params(), main(), nuclear_anchor_test(), run_all_calculations(), madness::TDHF::test(), test_capitalization(), test_comment_lines(), test_derived(), test_empty_lines(), test_fock(), test_nemo(), test_not_allowed(), test_read_restartaodata(), test_read_restartdata(), test_serialize(), test_trailing_characters(), test_type_conversion1(), test_type_conversion2(), test_type_conversion3(), test_type_conversion4(), test_type_conversion5(), test_type_conversion6(), test_type_conversion7(), and test_type_conversion8().
|
inlinestatic |
split a string s into a vector of strings, using delimiter
[in] | s | the string (pass by value!) |
Referenced by check_for_input_file(), and madness::QCParameter::print_line().
|
inlinestatic |
make lower case
References c.
Referenced by key_exists(), madness::MolecularOptimizer::projector_external_dof(), set_keyval(), and value().
|
inlinestatic |
remove blanks at the beginning and the end only
References madness::arg().
Referenced by set_keyval().
|
inline |
References key_exists(), keyval, MADNESS_CHECK, and tolower().
Referenced by madness::Molecule::GeometryParameters::derive_source_type_from_name(), main(), main(), madness::QCCalculationParametersBase::read_commandline_options(), madness::QCCalculationParametersBase::read_input_and_commandline_options(), madness::Molecule::GeometryParameters::set_derived_values(), madness::CalculationParameters::set_derived_values(), madness::Molecule::GeometryParameters::set_global_convenience_options(), set_keyval(), and madness::TDHF::test().
std::map<std::string, std::string> madness::commandlineparser::keyval |
Referenced by key_exists(), print_map(), set_defaults(), set_keyval(), and value().