![]() |
Leonetienne/Hazelnupp
Simple, easy to use, command line parameter interface
|
The main class to interface with. More...
#include <Hazelnupp.h>
Public Member Functions | |
| Hazelnupp () | |
| Hazelnupp (const int argc, const char *const *argv) | |
| ~Hazelnupp () | |
| void | Parse (const int argc, const char *const *argv) |
| Will parse command line arguments. More... | |
| const std::string & | GetExecutableName () const |
| Will return argv[0], the name of the executable. More... | |
| const Value & | operator[] (const std::string &key) const |
| Will return the value given a key. More... | |
| bool | HasParam (const std::string &key) const |
| Will check wether a parameter exists given a key, or not. More... | |
| void | RegisterAbbreviation (const std::string &abbrev, const std::string &target) |
| Will register an abbreviation (like -f for –force) More... | |
| const std::string & | GetAbbreviation (const std::string &abbrev) const |
| Will return the long form of an abbreviation (like –force for -f) More... | |
| bool | HasAbbreviation (const std::string &abbrev) const |
| Will check wether or not an abbreviation is registered. More... | |
| void | ClearAbbreviations () |
| Will delete all abbreviations. More... | |
| void | RegisterConstraints (const std::vector< ParamConstraint > &constraints) |
| Will register parameter constraints. More... | |
| void | ClearConstraints () |
| Will delete all constraints. More... | |
| void | SetCrashOnFail (bool crashOnFail) |
| Sets whether to crash the application, and print to stderr, when an exception is raised whilst parsing, or not. More... | |
| bool | GetCrashOnFail () const |
| Gets whether the application crashes on an exception whilst parsing, and prints to stderr. More... | |
The main class to interface with.
Definition at line 9 of file Hazelnupp.h.
| Hazelnupp::Hazelnupp | ( | ) |
Definition at line 12 of file Hazelnupp.cpp.
| Hazelnupp::Hazelnupp | ( | const int | argc, |
| const char *const * | argv | ||
| ) |
Definition at line 17 of file Hazelnupp.cpp.
| Hazelnupp::~Hazelnupp | ( | ) |
Definition at line 23 of file Hazelnupp.cpp.
| void Hazelnupp::ClearAbbreviations | ( | ) |
Will delete all abbreviations.
Definition at line 346 of file Hazelnupp.cpp.
| void Hazelnupp::ClearConstraints | ( | ) |
Will delete all constraints.
Definition at line 373 of file Hazelnupp.cpp.
| const std::string & Hazelnupp::GetAbbreviation | ( | const std::string & | abbrev | ) | const |
Will return the long form of an abbreviation (like –force for -f)
Definition at line 336 of file Hazelnupp.cpp.
| bool Hazelnupp::GetCrashOnFail | ( | ) | const |
Gets whether the application crashes on an exception whilst parsing, and prints to stderr.
Definition at line 277 of file Hazelnupp.cpp.
| const std::string & Hazelnupp::GetExecutableName | ( | ) | const |
Will return argv[0], the name of the executable.
Definition at line 316 of file Hazelnupp.cpp.
| bool Hazelnupp::HasAbbreviation | ( | const std::string & | abbrev | ) | const |
Will check wether or not an abbreviation is registered.
Definition at line 341 of file Hazelnupp.cpp.
| bool Hazelnupp::HasParam | ( | const std::string & | key | ) | const |
Will check wether a parameter exists given a key, or not.
Definition at line 151 of file Hazelnupp.cpp.
| const Value & Hazelnupp::operator[] | ( | const std::string & | key | ) | const |
| void Hazelnupp::Parse | ( | const int | argc, |
| const char *const * | argv | ||
| ) |
Will parse command line arguments.
Definition at line 33 of file Hazelnupp.cpp.
| void Hazelnupp::RegisterAbbreviation | ( | const std::string & | abbrev, |
| const std::string & | target | ||
| ) |
Will register an abbreviation (like -f for –force)
Definition at line 330 of file Hazelnupp.cpp.
| void Hazelnupp::RegisterConstraints | ( | const std::vector< ParamConstraint > & | constraints | ) |
| void Hazelnupp::SetCrashOnFail | ( | bool | crashOnFail | ) |
Sets whether to crash the application, and print to stderr, when an exception is raised whilst parsing, or not.
Definition at line 379 of file Hazelnupp.cpp.
1.8.17