![]() |
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 11 of file Hazelnupp.h.
Hazelnupp::Hazelnupp | ( | ) |
Definition at line 14 of file Hazelnupp.cpp.
Hazelnupp::Hazelnupp | ( | const int | argc, |
const char *const * | argv | ||
) |
Definition at line 19 of file Hazelnupp.cpp.
Hazelnupp::~Hazelnupp | ( | ) |
Definition at line 25 of file Hazelnupp.cpp.
void Hazelnupp::ClearAbbreviations | ( | ) |
Will delete all abbreviations.
Definition at line 348 of file Hazelnupp.cpp.
void Hazelnupp::ClearConstraints | ( | ) |
Will delete all constraints.
Definition at line 375 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 338 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 279 of file Hazelnupp.cpp.
const std::string & Hazelnupp::GetExecutableName | ( | ) | const |
Will return argv[0], the name of the executable.
Definition at line 318 of file Hazelnupp.cpp.
bool Hazelnupp::HasAbbreviation | ( | const std::string & | abbrev | ) | const |
Will check wether or not an abbreviation is registered.
Definition at line 343 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 153 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 35 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 332 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 381 of file Hazelnupp.cpp.