diff --git a/Hazelnupp/CMakeLists.txt b/Hazelnupp/CMakeLists.txt
new file mode 100644
index 0000000..055411b
--- /dev/null
+++ b/Hazelnupp/CMakeLists.txt
@@ -0,0 +1,43 @@
+cmake_minimum_required(VERSION 3.16)
+project(Hazelnupp)
+
+###################
+# Library project #
+###################
+set(CMAKE_CXX_STANDARD 17)
+
+FILE(GLOB main_src src/*.cpp)
+add_library(${PROJECT_NAME}
+ ${main_src}
+)
+
+target_include_directories(${PROJECT_NAME} PRIVATE
+ include
+)
+
+#########
+# Tests #
+#########
+FILE(GLOB test_src test/*.cpp)
+add_executable(test
+ test/Catch2.h
+ ${test_src}
+)
+target_link_libraries(test ${PROJECT_NAME})
+
+target_include_directories(test PRIVATE
+ include
+)
+
+##############
+# Executable #
+##############
+FILE(GLOB exec_src exec/*.cpp)
+add_executable(exec
+ ${exec_src}
+)
+target_link_libraries(exec ${PROJECT_NAME})
+
+target_include_directories(exec PRIVATE
+ include
+)
diff --git a/Hazelnupp/Hazelnupp.vcxproj b/Hazelnupp/Hazelnupp.vcxproj
deleted file mode 100644
index 5ba005c..0000000
--- a/Hazelnupp/Hazelnupp.vcxproj
+++ /dev/null
@@ -1,171 +0,0 @@
-
-
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
#include "Hazelnupp/CmdArgsInterface.h"
#include "Hazelnupp/VoidValue.h"
#include "Hazelnupp/IntValue.h"
#include "Hazelnupp/FloatValue.h"
#include "Hazelnupp/StringValue.h"
#include "Hazelnupp/ListValue.h"
#include "Hazelnupp/HazelnuppException.h"
#include "Hazelnupp/Placeholders.h"
#include "Hazelnupp/StringTools.h"
#include <iostream>
#include <cstdlib>
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
#include "Parameter.h"
#include "ParamConstraint.h"
#include <unordered_map>
#include <vector>
#include "Version.h"
Go to the source code of this file.
++Classes | |
class | Hazelnp::CmdArgsInterface |
The main class to interface with. More... | |
+Namespaces | |
namespace | Hazelnp |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
#include <string>
Go to the source code of this file.
++Namespaces | |
namespace | Hazelnp |
+Enumerations | |
enum class | Hazelnp::DATA_TYPE { + Hazelnp::VOID +, Hazelnp::INT +, Hazelnp::FLOAT +, Hazelnp::STRING +, + Hazelnp::LIST + + } |
The different data types a paramater can be. More... | |
+Functions | |
static std::string | Hazelnp::DataTypeToString (DATA_TYPE type) |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
Go to the source code of this file.
++Classes | |
class | Hazelnp::FloatValue |
Specializations for floating point values (uses long double) More... | |
+Namespaces | |
namespace | Hazelnp |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
Go to the source code of this file.
++Classes | |
class | Hazelnp::HazelnuppException |
Generic hazelnupp exception. More... | |
class | Hazelnp::HazelnuppInvalidKeyException |
Gets thrown when an non-existent key gets dereferenced. More... | |
class | Hazelnp::HazelnuppValueNotConvertibleException |
Gets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not convertible. More... | |
class | Hazelnp::HazelnuppConstraintException |
Gets thrown something bad happens because of parameter constraints. More... | |
class | Hazelnp::HazelnuppConstraintTypeMissmatch |
Gets thrown when a parameter is of a type that does not match the required type, and is not convertible to it. More... | |
class | Hazelnp::HazelnuppConstraintMissingValue |
Gets thrown when a parameter constrained to be required is not provided, and has no default value set. More... | |
class | Hazelnp::HazelnuppConstraintIncompatibleParameters |
Gets thrown when a parameter constrained to be incompatible with other parameters gets supplied alongside at least one of those incompatible ones. More... | |
+Namespaces | |
namespace | Hazelnp |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
#include "Value.h"
Go to the source code of this file.
++Classes | |
class | Hazelnp::IntValue |
Specializations for integer values (uses long long int) More... | |
+Namespaces | |
namespace | Hazelnp |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
Go to the source code of this file.
++Classes | |
class | Hazelnp::ListValue |
Specializations for list values (uses std::vector<Value*>) More... | |
+Namespaces | |
namespace | Hazelnp |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
Go to the source code of this file.
++Classes | |
struct | Hazelnp::ParamConstraint |
+Namespaces | |
namespace | Hazelnp |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
#include "Hazelnupp/Parameter.h"
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
Go to the source code of this file.
++Classes | |
class | Hazelnp::Parameter |
+Namespaces | |
namespace | Hazelnp |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
#include <string>
Go to the source code of this file.
++Namespaces | |
namespace | Hazelnp |
namespace | Hazelnp::Placeholders |
+Variables | |
static const std::string | Hazelnp::Placeholders::g_emptyString |
The only purpose of this is to provide the ability to return an empty string as an error for std::string& methods. More... | |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
#include "Hazelnupp/StringTools.h"
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
#include <string>
#include <sstream>
#include <vector>
#include <cmath>
Go to the source code of this file.
++Classes | |
class | Hazelnp::Internal::StringTools |
Internal helper class. More... | |
+Namespaces | |
namespace | Hazelnp |
namespace | Hazelnp::Internal |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
Go to the source code of this file.
++Classes | |
class | Hazelnp::StringValue |
Specializations for string values (uses std::string) More... | |
+Namespaces | |
namespace | Hazelnp |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
#include "Hazelnupp/Value.h"
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
Go to the source code of this file.
++Classes | |
class | Hazelnp::Value |
Abstract class for values. More... | |
+Namespaces | |
namespace | Hazelnp |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
Go to the source code of this file.
++Macros | |
#define | HAZELNUPP_VERSION (1.122) |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
#include "Value.h"
Go to the source code of this file.
++Classes | |
class | Hazelnp::VoidValue |
Specializations for void values. More... | |
+Namespaces | |
namespace | Hazelnp |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
▼NHazelnp | |
▼NInternal | |
CStringTools | Internal helper class |
CCmdArgsInterface | The main class to interface with |
CFloatValue | Specializations for floating point values (uses long double) |
CHazelnuppConstraintException | Gets thrown something bad happens because of parameter constraints |
CHazelnuppConstraintIncompatibleParameters | Gets thrown when a parameter constrained to be incompatible with other parameters gets supplied alongside at least one of those incompatible ones |
CHazelnuppConstraintMissingValue | Gets thrown when a parameter constrained to be required is not provided, and has no default value set |
CHazelnuppConstraintTypeMissmatch | Gets thrown when a parameter is of a type that does not match the required type, and is not convertible to it |
CHazelnuppException | Generic hazelnupp exception |
CHazelnuppInvalidKeyException | Gets thrown when an non-existent key gets dereferenced |
CHazelnuppValueNotConvertibleException | Gets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not convertible |
CIntValue | Specializations for integer values (uses long long int) |
CListValue | Specializations for list values (uses std::vector<Value*>) |
CParamConstraint | |
CParameter | |
CStringValue | Specializations for string values (uses std::string) |
CValue | Abstract class for values |
CVoidValue | Specializations for void values |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
This is the complete list of members for Hazelnp::CmdArgsInterface, including all inherited members.
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
The main class to interface with. + More...
+ +#include <CmdArgsInterface.h>
+Public Member Functions | |
CmdArgsInterface () | |
CmdArgsInterface (const int argc, const char *const *argv) | |
~CmdArgsInterface () | |
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) + Returns "" if no match is found. More... | |
bool | HasAbbreviation (const std::string &abbrev) const |
Will check wether or not an abbreviation is registered. More... | |
void | ClearAbbreviation (const std::string &abbrevation) |
Will delete the abbreviation for a given parameter. More... | |
void | ClearAbbreviations () |
Will delete all abbreviations. More... | |
void | RegisterConstraint (const std::string &key, const ParamConstraint &constraint) |
Will register a constraint for a parameter. More... | |
ParamConstraint | GetConstraint (const std::string ¶meter) const |
Will return the constraint information for a specific parameter. More... | |
void | ClearConstraint (const std::string ¶meter) |
Will the constraint of a specific parameter. 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... | |
void | SetCatchHelp (bool catchHelp) |
Sets whether the CmdArgsInterface should automatically catch the –help parameter, print the parameter documentation to stdout, and exit or not. More... | |
bool | GetCatchHelp () const |
Retruns whether the CmdArgsInterface should automatically catch the –help parameter, print the parameter documentation to stdout, and exit or not. More... | |
void | SetBriefDescription (const std::string &description) |
Sets a brief description of the application to be automatically added to the documentation. More... | |
const std::string & | GetBriefDescription () |
Returns the brief description of the application to be automatically added to the documentation. More... | |
void | RegisterDescription (const std::string ¶meter, const std::string &description) |
Willl register a short description for a parameter. More... | |
const std::string & | GetDescription (const std::string ¶meter) const |
Will return a short description for a parameter, if it exists. More... | |
bool | HasDescription (const std::string ¶meter) const |
Returns whether or not a given parameter has a registered description. More... | |
void | ClearDescription (const std::string ¶meter) |
Will delete the description of a parameter if it exists. More... | |
void | ClearDescriptions () |
Will delete all parameter descriptions. More... | |
std::string | GenerateDocumentation () const |
Will generate a text-based documentation suited to show the user, for example on –help. More... | |
The main class to interface with.
+ +Definition at line 13 of file CmdArgsInterface.h.
+CmdArgsInterface::CmdArgsInterface | +( | +) | ++ |
Definition at line 15 of file CmdArgsInterface.cpp.
+CmdArgsInterface::CmdArgsInterface | +( | +const int | +argc, | +
+ | + | const char *const * | +argv | +
+ | ) | ++ |
Definition at line 20 of file CmdArgsInterface.cpp.
+CmdArgsInterface::~CmdArgsInterface | +( | +) | ++ |
Definition at line 26 of file CmdArgsInterface.cpp.
+void CmdArgsInterface::ClearAbbreviation | +( | +const std::string & | +abbrevation | ) | ++ |
Will delete the abbreviation for a given parameter.
+
+ IMPORTANT: This parameter is the abbreviation! Not the long form!
Definition at line 651 of file CmdArgsInterface.cpp.
+void CmdArgsInterface::ClearAbbreviations | +( | +) | ++ |
Will delete all abbreviations.
+ +Definition at line 657 of file CmdArgsInterface.cpp.
+void CmdArgsInterface::ClearConstraint | +( | +const std::string & | +parameter | ) | ++ |
Will the constraint of a specific parameter.
+ +Definition at line 612 of file CmdArgsInterface.cpp.
+void CmdArgsInterface::ClearConstraints | +( | +) | ++ |
Will delete all constraints.
+ +Definition at line 670 of file CmdArgsInterface.cpp.
+void CmdArgsInterface::ClearDescription | +( | +const std::string & | +parameter | ) | ++ |
Will delete the description of a parameter if it exists.
+ +Definition at line 412 of file CmdArgsInterface.cpp.
+void Hazelnp::CmdArgsInterface::ClearDescriptions | +( | +) | ++ |
Will delete all parameter descriptions.
+ +Definition at line 419 of file CmdArgsInterface.cpp.
+std::string CmdArgsInterface::GenerateDocumentation | +( | +) | +const | +
Will generate a text-based documentation suited to show the user, for example on –help.
+ +Definition at line 425 of file CmdArgsInterface.cpp.
+const std::string & CmdArgsInterface::GetAbbreviation | +( | +const std::string & | +abbrev | ) | +const | +
Will return the long form of an abbreviation (like –force for -f)
+ Returns "" if no match is found.
Definition at line 638 of file CmdArgsInterface.cpp.
+const std::string & CmdArgsInterface::GetBriefDescription | +( | +) | ++ |
Returns the brief description of the application to be automatically added to the documentation.
+ +Definition at line 385 of file CmdArgsInterface.cpp.
+bool CmdArgsInterface::GetCatchHelp | +( | +) | +const | +
Retruns whether the CmdArgsInterface should automatically catch the –help parameter, print the parameter documentation to stdout, and exit or not.
+ +Definition at line 374 of file CmdArgsInterface.cpp.
+ParamConstraint CmdArgsInterface::GetConstraint | +( | +const std::string & | +parameter | ) | +const | +
Will return the constraint information for a specific parameter.
+ +Definition at line 607 of file CmdArgsInterface.cpp.
+bool CmdArgsInterface::GetCrashOnFail | +( | +) | +const | +
Gets whether the application crashes on an exception whilst parsing, and prints to stderr.
+ +Definition at line 363 of file CmdArgsInterface.cpp.
+const std::string & Hazelnp::CmdArgsInterface::GetDescription | +( | +const std::string & | +parameter | ) | +const | +
Will return a short description for a parameter, if it exists.
+
+ Empty string if it does not exist.
Definition at line 396 of file CmdArgsInterface.cpp.
+const std::string & CmdArgsInterface::GetExecutableName | +( | +) | +const | +
Will return argv[0], the name of the executable.
+ +Definition at line 618 of file CmdArgsInterface.cpp.
+bool CmdArgsInterface::HasAbbreviation | +( | +const std::string & | +abbrev | ) | +const | +
Will check wether or not an abbreviation is registered.
+ +Definition at line 646 of file CmdArgsInterface.cpp.
+bool CmdArgsInterface::HasDescription | +( | +const std::string & | +parameter | ) | +const | +
Returns whether or not a given parameter has a registered description.
+ +Definition at line 407 of file CmdArgsInterface.cpp.
+bool CmdArgsInterface::HasParam | +( | +const std::string & | +key | ) | +const | +
Will check wether a parameter exists given a key, or not.
+ +Definition at line 199 of file CmdArgsInterface.cpp.
+const Value & CmdArgsInterface::operator[] | +( | +const std::string & | +key | ) | +const | +
Will return the value given a key.
+ +Definition at line 623 of file CmdArgsInterface.cpp.
+void CmdArgsInterface::Parse | +( | +const int | +argc, | +
+ | + | const char *const * | +argv | +
+ | ) | ++ |
Will parse command line arguments.
+ +Definition at line 36 of file CmdArgsInterface.cpp.
+void CmdArgsInterface::RegisterAbbreviation | +( | +const std::string & | +abbrev, | +
+ | + | const std::string & | +target | +
+ | ) | ++ |
Will register an abbreviation (like -f for –force)
+ +Definition at line 632 of file CmdArgsInterface.cpp.
+void CmdArgsInterface::RegisterConstraint | +( | +const std::string & | +key, | +
+ | + | const ParamConstraint & | +constraint | +
+ | ) | ++ |
Will register a constraint for a parameter.
+IMPORTANT: Any parameter can only have ONE constraint. Applying a new one will overwrite the old one! Construct the ParamConstraint struct yourself to combine Require, TypeSafety and Incompatibilities! You can also use the ParamConstraint constructor!
+ +Definition at line 663 of file CmdArgsInterface.cpp.
+void Hazelnp::CmdArgsInterface::RegisterDescription | +( | +const std::string & | +parameter, | +
+ | + | const std::string & | +description | +
+ | ) | ++ |
Willl register a short description for a parameter.
+
+ Will overwrite existing descriptions for that parameter.
Definition at line 390 of file CmdArgsInterface.cpp.
+void CmdArgsInterface::SetBriefDescription | +( | +const std::string & | +description | ) | ++ |
Sets a brief description of the application to be automatically added to the documentation.
+ +Definition at line 379 of file CmdArgsInterface.cpp.
+void CmdArgsInterface::SetCatchHelp | +( | +bool | +catchHelp | ) | ++ |
Sets whether the CmdArgsInterface should automatically catch the –help parameter, print the parameter documentation to stdout, and exit or not.
+ +Definition at line 368 of file CmdArgsInterface.cpp.
+void CmdArgsInterface::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 676 of file CmdArgsInterface.cpp.
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
This is the complete list of members for Hazelnp::FloatValue, including all inherited members.
+Deepcopy() const override | Hazelnp::FloatValue | virtual |
FloatValue(const long double &value) | Hazelnp::FloatValue | |
GetAsOsString() const override | Hazelnp::FloatValue | virtual |
GetDataType() const | Hazelnp::Value | |
GetFloat32() const override | Hazelnp::FloatValue | virtual |
GetFloat64() const override | Hazelnp::FloatValue | virtual |
GetInt32() const override | Hazelnp::FloatValue | virtual |
GetInt64() const override | Hazelnp::FloatValue | virtual |
GetList() const override | Hazelnp::FloatValue | virtual |
GetString() const override | Hazelnp::FloatValue | virtual |
GetValue() const | Hazelnp::FloatValue | |
operator double() const | Hazelnp::FloatValue | |
operator long double() const | Hazelnp::FloatValue | |
type | Hazelnp::Value | protected |
Value(DATA_TYPE type) | Hazelnp::Value | protected |
~FloatValue() override | Hazelnp::FloatValue | inline |
~Value() | Hazelnp::Value | inlinevirtual |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
Specializations for floating point values (uses long double) + More...
+ +#include <FloatValue.h>
+Public Member Functions | |
FloatValue (const long double &value) | |
~FloatValue () override | |
Value * | Deepcopy () const override |
Will return a deeopopy of this object. More... | |
std::string | GetAsOsString () const override |
Will return a string suitable for an std::ostream;. More... | |
const long double & | GetValue () const |
Will return the raw value. More... | |
operator long double () const | |
operator double () const | |
long long int | GetInt64 () const override |
Will return the data as a long long int. More... | |
int | GetInt32 () const override |
Will return the data as an int. More... | |
long double | GetFloat64 () const override |
Will return the data as a long double. More... | |
double | GetFloat32 () const override |
Will return the data as a double. More... | |
std::string | GetString () const override |
Will return the data as a string. More... | |
const std::vector< Value * > & | GetList () const override |
Throws HazelnuppValueNotConvertibleException. More... | |
![]() | |
virtual | ~Value () |
virtual Value * | Deepcopy () const =0 |
Will return a deeopopy of this object. More... | |
virtual std::string | GetAsOsString () const =0 |
Will return a string suitable for an std::ostream. More... | |
DATA_TYPE | GetDataType () const |
Will return the data type of this value. More... | |
virtual long long int | GetInt64 () const =0 |
Will attempt to return the integer data (long long) More... | |
virtual int | GetInt32 () const =0 |
Will attempt to return the integer data (int) More... | |
virtual long double | GetFloat64 () const =0 |
Will attempt to return the floating-point data (long double) More... | |
virtual double | GetFloat32 () const =0 |
Will attempt to return the floating-point data (double) More... | |
virtual std::string | GetString () const =0 |
Will attempt to return the string-data. More... | |
virtual const std::vector< Value * > & | GetList () const =0 |
Will attempt to return the list-data. More... | |
+Additional Inherited Members | |
![]() | |
Value (DATA_TYPE type) | |
![]() | |
DATA_TYPE | type |
Specializations for floating point values (uses long double)
+ +Definition at line 9 of file FloatValue.h.
+FloatValue::FloatValue | +( | +const long double & | +value | ) | ++ |
Definition at line 7 of file FloatValue.cpp.
+
+
|
+ +inlineoverride | +
Definition at line 13 of file FloatValue.h.
+
+
|
+ +overridevirtual | +
Will return a deeopopy of this object.
+ +Implements Hazelnp::Value.
+ +Definition at line 15 of file FloatValue.cpp.
+
+
|
+ +overridevirtual | +
Will return a string suitable for an std::ostream;.
+ +Implements Hazelnp::Value.
+ +Definition at line 20 of file FloatValue.cpp.
+
+
|
+ +overridevirtual | +
Will return the data as a double.
+ +Implements Hazelnp::Value.
+ +Definition at line 59 of file FloatValue.cpp.
+
+
|
+ +overridevirtual | +
Will return the data as a long double.
+ +Implements Hazelnp::Value.
+ +Definition at line 54 of file FloatValue.cpp.
+
+
|
+ +overridevirtual | +
Will return the data as an int.
+ +Implements Hazelnp::Value.
+ +Definition at line 49 of file FloatValue.cpp.
+
+
|
+ +overridevirtual | +
Will return the data as a long long int.
+ +Implements Hazelnp::Value.
+ +Definition at line 44 of file FloatValue.cpp.
+
+
|
+ +overridevirtual | +
Throws HazelnuppValueNotConvertibleException.
+ +Implements Hazelnp::Value.
+ +Definition at line 72 of file FloatValue.cpp.
+
+
|
+ +overridevirtual | +
Will return the data as a string.
+ +Implements Hazelnp::Value.
+ +Definition at line 64 of file FloatValue.cpp.
+const long double & FloatValue::GetValue | +( | +) | +const | +
Will return the raw value.
+ +Definition at line 27 of file FloatValue.cpp.
+FloatValue::operator double | +( | +) | +const | +
Definition at line 37 of file FloatValue.cpp.
+FloatValue::operator long double | +( | +) | +const | +
Definition at line 32 of file FloatValue.cpp.
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
This is the complete list of members for Hazelnp::HazelnuppConstraintException, including all inherited members.
+HazelnuppConstraintException() | Hazelnp::HazelnuppConstraintException | inline |
HazelnuppConstraintException(const std::string &msg) | Hazelnp::HazelnuppConstraintException | inline |
HazelnuppException() | Hazelnp::HazelnuppException | inline |
HazelnuppException(const std::string &msg) | Hazelnp::HazelnuppException | inline |
message | Hazelnp::HazelnuppException | protected |
What() const | Hazelnp::HazelnuppException | inline |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
Gets thrown something bad happens because of parameter constraints. + More...
+ +#include <HazelnuppException.h>
+Public Member Functions | |
HazelnuppConstraintException () | |
HazelnuppConstraintException (const std::string &msg) | |
![]() | |
HazelnuppException () | |
HazelnuppException (const std::string &msg) | |
const std::string & | What () const |
Will return an error message. More... | |
+Additional Inherited Members | |
![]() | |
std::string | message |
Gets thrown something bad happens because of parameter constraints.
+ +Definition at line 47 of file HazelnuppException.h.
+
+
|
+ +inline | +
Definition at line 50 of file HazelnuppException.h.
+
+
|
+ +inline | +
Definition at line 51 of file HazelnuppException.h.
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
This is the complete list of members for Hazelnp::HazelnuppConstraintIncompatibleParameters, including all inherited members.
+HazelnuppConstraintException() | Hazelnp::HazelnuppConstraintException | inline |
HazelnuppConstraintException(const std::string &msg) | Hazelnp::HazelnuppConstraintException | inline |
HazelnuppConstraintIncompatibleParameters() | Hazelnp::HazelnuppConstraintIncompatibleParameters | inline |
HazelnuppConstraintIncompatibleParameters(const std::string &key1, const std::string &key2) | Hazelnp::HazelnuppConstraintIncompatibleParameters | inline |
HazelnuppException() | Hazelnp::HazelnuppException | inline |
HazelnuppException(const std::string &msg) | Hazelnp::HazelnuppException | inline |
message | Hazelnp::HazelnuppException | protected |
What() const | Hazelnp::HazelnuppException | inline |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
Gets thrown when a parameter constrained to be incompatible with other parameters gets supplied alongside at least one of those incompatible ones. + More...
+ +#include <HazelnuppException.h>
+Public Member Functions | |
HazelnuppConstraintIncompatibleParameters () | |
HazelnuppConstraintIncompatibleParameters (const std::string &key1, const std::string &key2) | |
![]() | |
HazelnuppConstraintException () | |
HazelnuppConstraintException (const std::string &msg) | |
![]() | |
HazelnuppException () | |
HazelnuppException (const std::string &msg) | |
const std::string & | What () const |
Will return an error message. More... | |
+Additional Inherited Members | |
![]() | |
std::string | message |
Gets thrown when a parameter constrained to be incompatible with other parameters gets supplied alongside at least one of those incompatible ones.
+ +Definition at line 101 of file HazelnuppException.h.
+
+
|
+ +inline | +
Definition at line 104 of file HazelnuppException.h.
+
+
|
+ +inline | +
Definition at line 105 of file HazelnuppException.h.
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
This is the complete list of members for Hazelnp::HazelnuppConstraintMissingValue, including all inherited members.
+HazelnuppConstraintException() | Hazelnp::HazelnuppConstraintException | inline |
HazelnuppConstraintException(const std::string &msg) | Hazelnp::HazelnuppConstraintException | inline |
HazelnuppConstraintMissingValue() | Hazelnp::HazelnuppConstraintMissingValue | inline |
HazelnuppConstraintMissingValue(const std::string &key, const std::string ¶mDescription="") | Hazelnp::HazelnuppConstraintMissingValue | inline |
HazelnuppException() | Hazelnp::HazelnuppException | inline |
HazelnuppException(const std::string &msg) | Hazelnp::HazelnuppException | inline |
message | Hazelnp::HazelnuppException | protected |
What() const | Hazelnp::HazelnuppException | inline |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
Gets thrown when a parameter constrained to be required is not provided, and has no default value set. + More...
+ +#include <HazelnuppException.h>
+Public Member Functions | |
HazelnuppConstraintMissingValue () | |
HazelnuppConstraintMissingValue (const std::string &key, const std::string ¶mDescription="") | |
![]() | |
HazelnuppConstraintException () | |
HazelnuppConstraintException (const std::string &msg) | |
![]() | |
HazelnuppException () | |
HazelnuppException (const std::string &msg) | |
const std::string & | What () const |
Will return an error message. More... | |
+Additional Inherited Members | |
![]() | |
std::string | message |
Gets thrown when a parameter constrained to be required is not provided, and has no default value set.
+ +Definition at line 80 of file HazelnuppException.h.
+
+
|
+ +inline | +
Definition at line 83 of file HazelnuppException.h.
+
+
|
+ +inline | +
Definition at line 84 of file HazelnuppException.h.
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
This is the complete list of members for Hazelnp::HazelnuppConstraintTypeMissmatch, including all inherited members.
+HazelnuppConstraintException() | Hazelnp::HazelnuppConstraintException | inline |
HazelnuppConstraintException(const std::string &msg) | Hazelnp::HazelnuppConstraintException | inline |
HazelnuppConstraintTypeMissmatch() | Hazelnp::HazelnuppConstraintTypeMissmatch | inline |
HazelnuppConstraintTypeMissmatch(const std::string &msg) | Hazelnp::HazelnuppConstraintTypeMissmatch | inline |
HazelnuppConstraintTypeMissmatch(const std::string &key, const DATA_TYPE requiredType, const DATA_TYPE actualType, const std::string ¶mDescription="") | Hazelnp::HazelnuppConstraintTypeMissmatch | inline |
HazelnuppException() | Hazelnp::HazelnuppException | inline |
HazelnuppException(const std::string &msg) | Hazelnp::HazelnuppException | inline |
message | Hazelnp::HazelnuppException | protected |
What() const | Hazelnp::HazelnuppException | inline |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
Gets thrown when a parameter is of a type that does not match the required type, and is not convertible to it. + More...
+ +#include <HazelnuppException.h>
+Public Member Functions | |
HazelnuppConstraintTypeMissmatch () | |
HazelnuppConstraintTypeMissmatch (const std::string &msg) | |
HazelnuppConstraintTypeMissmatch (const std::string &key, const DATA_TYPE requiredType, const DATA_TYPE actualType, const std::string ¶mDescription="") | |
![]() | |
HazelnuppConstraintException () | |
HazelnuppConstraintException (const std::string &msg) | |
![]() | |
HazelnuppException () | |
HazelnuppException (const std::string &msg) | |
const std::string & | What () const |
Will return an error message. More... | |
+Additional Inherited Members | |
![]() | |
std::string | message |
Gets thrown when a parameter is of a type that does not match the required type, and is not convertible to it.
+ +Definition at line 56 of file HazelnuppException.h.
+
+
|
+ +inline | +
Definition at line 59 of file HazelnuppException.h.
+
+
|
+ +inline | +
Definition at line 60 of file HazelnuppException.h.
+
+
|
+ +inline | +
Definition at line 62 of file HazelnuppException.h.
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
This is the complete list of members for Hazelnp::HazelnuppException, including all inherited members.
+HazelnuppException() | Hazelnp::HazelnuppException | inline |
HazelnuppException(const std::string &msg) | Hazelnp::HazelnuppException | inline |
message | Hazelnp::HazelnuppException | protected |
What() const | Hazelnp::HazelnuppException | inline |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
Generic hazelnupp exception. + More...
+ +#include <HazelnuppException.h>
+Public Member Functions | |
HazelnuppException () | |
HazelnuppException (const std::string &msg) | |
const std::string & | What () const |
Will return an error message. More... | |
+Protected Attributes | |
std::string | message |
Generic hazelnupp exception.
+ +Definition at line 11 of file HazelnuppException.h.
+
+
|
+ +inline | +
Definition at line 14 of file HazelnuppException.h.
+
+
|
+ +inline | +
Definition at line 15 of file HazelnuppException.h.
+
+
|
+ +inline | +
Will return an error message.
+ +Definition at line 18 of file HazelnuppException.h.
+ +
+
|
+ +protected | +
Definition at line 24 of file HazelnuppException.h.
+ +
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
This is the complete list of members for Hazelnp::HazelnuppInvalidKeyException, including all inherited members.
+HazelnuppException() | Hazelnp::HazelnuppException | inline |
HazelnuppException(const std::string &msg) | Hazelnp::HazelnuppException | inline |
HazelnuppInvalidKeyException() | Hazelnp::HazelnuppInvalidKeyException | inline |
HazelnuppInvalidKeyException(const std::string &msg) | Hazelnp::HazelnuppInvalidKeyException | inline |
message | Hazelnp::HazelnuppException | protected |
What() const | Hazelnp::HazelnuppException | inline |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
Gets thrown when an non-existent key gets dereferenced. + More...
+ +#include <HazelnuppException.h>
+Public Member Functions | |
HazelnuppInvalidKeyException () | |
HazelnuppInvalidKeyException (const std::string &msg) | |
![]() | |
HazelnuppException () | |
HazelnuppException (const std::string &msg) | |
const std::string & | What () const |
Will return an error message. More... | |
+Additional Inherited Members | |
![]() | |
std::string | message |
Gets thrown when an non-existent key gets dereferenced.
+ +Definition at line 29 of file HazelnuppException.h.
+
+
|
+ +inline | +
Definition at line 32 of file HazelnuppException.h.
+
+
|
+ +inline | +
Definition at line 33 of file HazelnuppException.h.
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
This is the complete list of members for Hazelnp::HazelnuppValueNotConvertibleException, including all inherited members.
+HazelnuppException() | Hazelnp::HazelnuppException | inline |
HazelnuppException(const std::string &msg) | Hazelnp::HazelnuppException | inline |
HazelnuppValueNotConvertibleException() | Hazelnp::HazelnuppValueNotConvertibleException | inline |
HazelnuppValueNotConvertibleException(const std::string &msg) | Hazelnp::HazelnuppValueNotConvertibleException | inline |
message | Hazelnp::HazelnuppException | protected |
What() const | Hazelnp::HazelnuppException | inline |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
Gets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not convertible. + More...
+ +#include <HazelnuppException.h>
+Public Member Functions | |
HazelnuppValueNotConvertibleException () | |
HazelnuppValueNotConvertibleException (const std::string &msg) | |
![]() | |
HazelnuppException () | |
HazelnuppException (const std::string &msg) | |
const std::string & | What () const |
Will return an error message. More... | |
+Additional Inherited Members | |
![]() | |
std::string | message |
Gets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not convertible.
+ +Definition at line 38 of file HazelnuppException.h.
+
+
|
+ +inline | +
Definition at line 41 of file HazelnuppException.h.
+
+
|
+ +inline | +
Definition at line 42 of file HazelnuppException.h.
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
This is the complete list of members for Hazelnp::IntValue, including all inherited members.
+Deepcopy() const override | Hazelnp::IntValue | virtual |
GetAsOsString() const override | Hazelnp::IntValue | virtual |
GetDataType() const | Hazelnp::Value | |
GetFloat32() const override | Hazelnp::IntValue | virtual |
GetFloat64() const override | Hazelnp::IntValue | virtual |
GetInt32() const override | Hazelnp::IntValue | virtual |
GetInt64() const override | Hazelnp::IntValue | virtual |
GetList() const override | Hazelnp::IntValue | virtual |
GetString() const override | Hazelnp::IntValue | virtual |
GetValue() const | Hazelnp::IntValue | |
IntValue(const long long int &value) | Hazelnp::IntValue | |
operator int() const | Hazelnp::IntValue | |
operator long long int() const | Hazelnp::IntValue | |
type | Hazelnp::Value | protected |
Value(DATA_TYPE type) | Hazelnp::Value | protected |
~IntValue() override | Hazelnp::IntValue | inline |
~Value() | Hazelnp::Value | inlinevirtual |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
Specializations for integer values (uses long long int) + More...
+ +#include <IntValue.h>
+Public Member Functions | |
IntValue (const long long int &value) | |
~IntValue () override | |
Value * | Deepcopy () const override |
Will return a deeopopy of this object. More... | |
std::string | GetAsOsString () const override |
Will return a string suitable for an std::ostream;. More... | |
const long long int & | GetValue () const |
Will return the raw value. More... | |
operator long long int () const | |
operator int () const | |
long long int | GetInt64 () const override |
Will return the data as a long long int. More... | |
int | GetInt32 () const override |
Will return the data as an int. More... | |
long double | GetFloat64 () const override |
Will return the data as a long double. More... | |
double | GetFloat32 () const override |
Will return the data as a double. More... | |
std::string | GetString () const override |
Will return the data as a string. More... | |
const std::vector< Value * > & | GetList () const override |
Throws HazelnuppValueNotConvertibleException. More... | |
![]() | |
virtual | ~Value () |
virtual Value * | Deepcopy () const =0 |
Will return a deeopopy of this object. More... | |
virtual std::string | GetAsOsString () const =0 |
Will return a string suitable for an std::ostream. More... | |
DATA_TYPE | GetDataType () const |
Will return the data type of this value. More... | |
virtual long long int | GetInt64 () const =0 |
Will attempt to return the integer data (long long) More... | |
virtual int | GetInt32 () const =0 |
Will attempt to return the integer data (int) More... | |
virtual long double | GetFloat64 () const =0 |
Will attempt to return the floating-point data (long double) More... | |
virtual double | GetFloat32 () const =0 |
Will attempt to return the floating-point data (double) More... | |
virtual std::string | GetString () const =0 |
Will attempt to return the string-data. More... | |
virtual const std::vector< Value * > & | GetList () const =0 |
Will attempt to return the list-data. More... | |
+Additional Inherited Members | |
![]() | |
Value (DATA_TYPE type) | |
![]() | |
DATA_TYPE | type |
Specializations for integer values (uses long long int)
+ +Definition at line 8 of file IntValue.h.
+IntValue::IntValue | +( | +const long long int & | +value | ) | ++ |
Definition at line 7 of file IntValue.cpp.
+
+
|
+ +inlineoverride | +
Definition at line 12 of file IntValue.h.
+
+
|
+ +overridevirtual | +
Will return a deeopopy of this object.
+ +Implements Hazelnp::Value.
+ +Definition at line 15 of file IntValue.cpp.
+
+
|
+ +overridevirtual | +
Will return a string suitable for an std::ostream;.
+ +Implements Hazelnp::Value.
+ +Definition at line 20 of file IntValue.cpp.
+
+
|
+ +overridevirtual | +
Will return the data as a double.
+ +Implements Hazelnp::Value.
+ +Definition at line 59 of file IntValue.cpp.
+
+
|
+ +overridevirtual | +
Will return the data as a long double.
+ +Implements Hazelnp::Value.
+ +Definition at line 54 of file IntValue.cpp.
+
+
|
+ +overridevirtual | +
Will return the data as an int.
+ +Implements Hazelnp::Value.
+ +Definition at line 49 of file IntValue.cpp.
+
+
|
+ +overridevirtual | +
Will return the data as a long long int.
+ +Implements Hazelnp::Value.
+ +Definition at line 44 of file IntValue.cpp.
+
+
|
+ +overridevirtual | +
Throws HazelnuppValueNotConvertibleException.
+ +Implements Hazelnp::Value.
+ +Definition at line 72 of file IntValue.cpp.
+
+
|
+ +overridevirtual | +
Will return the data as a string.
+ +Implements Hazelnp::Value.
+ +Definition at line 64 of file IntValue.cpp.
+const long long int & IntValue::GetValue | +( | +) | +const | +
Will return the raw value.
+ +Definition at line 27 of file IntValue.cpp.
+IntValue::operator int | +( | +) | +const | +
Definition at line 37 of file IntValue.cpp.
+IntValue::operator long long int | +( | +) | +const | +
Definition at line 32 of file IntValue.cpp.
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
This is the complete list of members for Hazelnp::Internal::StringTools, including all inherited members.
+Contains(const std::string &str, const char c) | Hazelnp::Internal::StringTools | static |
IsNumeric(const std::string &str, const bool allowDecimalPoint=false) | Hazelnp::Internal::StringTools | static |
ParseNumber(const std::string &str, bool &out_isInt, long double &out_number) | Hazelnp::Internal::StringTools | static |
Replace(const std::string &str, const char find, const std::string &subst) | Hazelnp::Internal::StringTools | static |
Replace(const std::string &str, const std::string &find, const std::string &subst) | Hazelnp::Internal::StringTools | static |
SplitString(const std::string &str, const char delimiter) | Hazelnp::Internal::StringTools | static |
SplitString(const std::string &str, const std::string &delimiter) | Hazelnp::Internal::StringTools | static |
ToLower(const std::string &str) | Hazelnp::Internal::StringTools | static |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
Internal helper class. + More...
+ +#include <StringTools.h>
+Static Public Member Functions | |
static bool | Contains (const std::string &str, const char c) |
Will return wether or not a given char is in a string. More... | |
static std::string | Replace (const std::string &str, const char find, const std::string &subst) |
Will replace a part of a string with another string. More... | |
static std::string | Replace (const std::string &str, const std::string &find, const std::string &subst) |
Will replace a part of a string with another string. More... | |
static bool | IsNumeric (const std::string &str, const bool allowDecimalPoint=false) |
Will return true if the given string consists only of digits (including signage) More... | |
static bool | ParseNumber (const std::string &str, bool &out_isInt, long double &out_number) |
Will convert the number in str to a number. More... | |
static std::vector< std::string > | SplitString (const std::string &str, const char delimiter) |
Will split a string by a delimiter char. The delimiter will be excluded! More... | |
static std::vector< std::string > | SplitString (const std::string &str, const std::string &delimiter) |
Will split a string by a delimiter string. The delimiter will be excluded! More... | |
static std::string | ToLower (const std::string &str) |
Will make a string all lower-case. More... | |
+
|
+ +static | +
Will return wether or not a given char is in a string.
+ +Definition at line 5 of file StringTools.cpp.
+
+
|
+ +static | +
Will return true if the given string consists only of digits (including signage)
+ +Definition at line 56 of file StringTools.cpp.
+
+
|
+ +static | +
Will convert the number in str to a number.
+
+ Returns wether or not the operation was successful.
+ Also returns wether the number is an integer, or floating point. If int, cast out_number to int.
Definition at line 82 of file StringTools.cpp.
+
+
|
+ +static | +
Will replace a part of a string with another string.
+ +Definition at line 14 of file StringTools.cpp.
+
+
|
+ +static | +
Will replace a part of a string with another string.
+ +Definition at line 27 of file StringTools.cpp.
+
+
|
+ +static | +
Will split a string by a delimiter char. The delimiter will be excluded!
+ +Definition at line 125 of file StringTools.cpp.
+
+
|
+ +static | +
Will split a string by a delimiter string. The delimiter will be excluded!
+ +Definition at line 132 of file StringTools.cpp.
+
+
|
+ +static | +
Will make a string all lower-case.
+ +Definition at line 173 of file StringTools.cpp.
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
This is the complete list of members for Hazelnp::ListValue, including all inherited members.
+AddValue(const Value *value) | Hazelnp::ListValue | |
Deepcopy() const override | Hazelnp::ListValue | virtual |
GetAsOsString() const override | Hazelnp::ListValue | virtual |
GetDataType() const | Hazelnp::Value | |
GetFloat32() const override | Hazelnp::ListValue | virtual |
GetFloat64() const override | Hazelnp::ListValue | virtual |
GetInt32() const override | Hazelnp::ListValue | virtual |
GetInt64() const override | Hazelnp::ListValue | virtual |
GetList() const override | Hazelnp::ListValue | virtual |
GetString() const override | Hazelnp::ListValue | virtual |
GetValue() const | Hazelnp::ListValue | |
ListValue() | Hazelnp::ListValue | |
operator std::vector< Value * >() const | Hazelnp::ListValue | |
type | Hazelnp::Value | protected |
Value(DATA_TYPE type) | Hazelnp::Value | protected |
~ListValue() override | Hazelnp::ListValue | |
~Value() | Hazelnp::Value | inlinevirtual |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
Specializations for list values (uses std::vector<Value*>) + More...
+ +#include <ListValue.h>
+Public Member Functions | |
ListValue () | |
~ListValue () override | |
Value * | Deepcopy () const override |
Will return a deeopopy of this object. More... | |
std::string | GetAsOsString () const override |
Will return a string suitable for an std::ostream;. More... | |
void | AddValue (const Value *value) |
Will add this value to the list. More... | |
const std::vector< Value * > & | GetValue () const |
Will return the raw value. More... | |
operator std::vector< Value * > () const | |
long long int | GetInt64 () const override |
Throws HazelnuppValueNotConvertibleException. More... | |
int | GetInt32 () const override |
Throws HazelnuppValueNotConvertibleException. More... | |
long double | GetFloat64 () const override |
Throws HazelnuppValueNotConvertibleException. More... | |
double | GetFloat32 () const override |
Throws HazelnuppValueNotConvertibleException. More... | |
std::string | GetString () const override |
Throws HazelnuppValueNotConvertibleException. More... | |
const std::vector< Value * > & | GetList () const override |
Will return this values list. More... | |
![]() | |
virtual | ~Value () |
virtual Value * | Deepcopy () const =0 |
Will return a deeopopy of this object. More... | |
virtual std::string | GetAsOsString () const =0 |
Will return a string suitable for an std::ostream. More... | |
DATA_TYPE | GetDataType () const |
Will return the data type of this value. More... | |
virtual long long int | GetInt64 () const =0 |
Will attempt to return the integer data (long long) More... | |
virtual int | GetInt32 () const =0 |
Will attempt to return the integer data (int) More... | |
virtual long double | GetFloat64 () const =0 |
Will attempt to return the floating-point data (long double) More... | |
virtual double | GetFloat32 () const =0 |
Will attempt to return the floating-point data (double) More... | |
virtual std::string | GetString () const =0 |
Will attempt to return the string-data. More... | |
virtual const std::vector< Value * > & | GetList () const =0 |
Will attempt to return the list-data. More... | |
+Additional Inherited Members | |
![]() | |
Value (DATA_TYPE type) | |
![]() | |
DATA_TYPE | type |
Specializations for list values (uses std::vector<Value*>)
+ +Definition at line 9 of file ListValue.h.
+ListValue::ListValue | +( | +) | ++ |
Definition at line 7 of file ListValue.cpp.
+
+
|
+ +override | +
Definition at line 13 of file ListValue.cpp.
+void ListValue::AddValue | +( | +const Value * | +value | ) | ++ |
Will add this value to the list.
+ +Definition at line 33 of file ListValue.cpp.
+ +
+
|
+ +overridevirtual | +
Will return a deeopopy of this object.
+ +Implements Hazelnp::Value.
+ +Definition at line 23 of file ListValue.cpp.
+
+
|
+ +overridevirtual | +
Will return a string suitable for an std::ostream;.
+ +Implements Hazelnp::Value.
+ +Definition at line 44 of file ListValue.cpp.
+
+
|
+ +overridevirtual | +
Throws HazelnuppValueNotConvertibleException.
+ +Implements Hazelnp::Value.
+ +Definition at line 84 of file ListValue.cpp.
+
+
|
+ +overridevirtual | +
Throws HazelnuppValueNotConvertibleException.
+ +Implements Hazelnp::Value.
+ +Definition at line 79 of file ListValue.cpp.
+ +
+
|
+ +overridevirtual | +
Throws HazelnuppValueNotConvertibleException.
+ +Implements Hazelnp::Value.
+ +Definition at line 74 of file ListValue.cpp.
+ +
+
|
+ +overridevirtual | +
Throws HazelnuppValueNotConvertibleException.
+ +Implements Hazelnp::Value.
+ +Definition at line 69 of file ListValue.cpp.
+ +
+
|
+ +overridevirtual | +
Will return this values list.
+ +Implements Hazelnp::Value.
+ +Definition at line 94 of file ListValue.cpp.
+
+
|
+ +overridevirtual | +
Throws HazelnuppValueNotConvertibleException.
+ +Implements Hazelnp::Value.
+ +Definition at line 89 of file ListValue.cpp.
+ +const std::vector< Value * > & ListValue::GetValue | +( | +) | +const | +
Will return the raw value.
+ +Definition at line 39 of file ListValue.cpp.
+ListValue::operator std::vector< Value * > | +( | +) | +const | +
Definition at line 62 of file ListValue.cpp.
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
This is the complete list of members for Hazelnp::Parameter, including all inherited members.
+GetValue() const | Hazelnp::Parameter | |
Key() const | Hazelnp::Parameter | |
operator<< | Hazelnp::Parameter | friend |
Parameter(const std::string &key, const Value *value) | Hazelnp::Parameter | explicit |
~Parameter() | Hazelnp::Parameter |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
#include <Parameter.h>
+Public Member Functions | |
Parameter (const std::string &key, const Value *value) | |
~Parameter () | |
const std::string & | Key () const |
Will return the key of this parameter. More... | |
const Value * | GetValue () const |
Will return the value of this parameter. More... | |
+Friends | |
std::ostream & | operator<< (std::ostream &os, const Parameter &p) |
Definition at line 8 of file Parameter.h.
+
+
|
+ +explicit | +
Definition at line 5 of file Parameter.cpp.
+ +Parameter::~Parameter | +( | +) | ++ |
Definition at line 13 of file Parameter.cpp.
+const ::Value * Parameter::GetValue | +( | +) | +const | +
Will return the value of this parameter.
+ +Definition at line 26 of file Parameter.cpp.
+const std::string & Parameter::Key | +( | +) | +const | +
Will return the key of this parameter.
+ +Definition at line 21 of file Parameter.cpp.
+
+
|
+ +friend | +
Definition at line 20 of file Parameter.h.
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
This is the complete list of members for Hazelnp::StringValue, including all inherited members.
+Deepcopy() const override | Hazelnp::StringValue | virtual |
GetAsOsString() const override | Hazelnp::StringValue | virtual |
GetDataType() const | Hazelnp::Value | |
GetFloat32() const override | Hazelnp::StringValue | virtual |
GetFloat64() const override | Hazelnp::StringValue | virtual |
GetInt32() const override | Hazelnp::StringValue | virtual |
GetInt64() const override | Hazelnp::StringValue | virtual |
GetList() const override | Hazelnp::StringValue | virtual |
GetString() const override | Hazelnp::StringValue | virtual |
GetValue() const | Hazelnp::StringValue | |
operator std::string() const | Hazelnp::StringValue | |
StringValue(const std::string &value) | Hazelnp::StringValue | |
type | Hazelnp::Value | protected |
Value(DATA_TYPE type) | Hazelnp::Value | protected |
~StringValue() override | Hazelnp::StringValue | inline |
~Value() | Hazelnp::Value | inlinevirtual |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
Specializations for string values (uses std::string) + More...
+ +#include <StringValue.h>
+Public Member Functions | |
StringValue (const std::string &value) | |
~StringValue () override | |
Value * | Deepcopy () const override |
Will return a deeopopy of this object. More... | |
std::string | GetAsOsString () const override |
Will return a string suitable for an std::ostream;. More... | |
const std::string & | GetValue () const |
Will return the raw value. More... | |
operator std::string () const | |
long long int | GetInt64 () const override |
Throws HazelnuppValueNotConvertibleException. More... | |
int | GetInt32 () const override |
Throws HazelnuppValueNotConvertibleException. More... | |
long double | GetFloat64 () const override |
Throws HazelnuppValueNotConvertibleException. More... | |
double | GetFloat32 () const override |
Throws HazelnuppValueNotConvertibleException. More... | |
std::string | GetString () const override |
Will return this value as a string. More... | |
const std::vector< Value * > & | GetList () const override |
Throws HazelnuppValueNotConvertibleException. More... | |
![]() | |
virtual | ~Value () |
virtual Value * | Deepcopy () const =0 |
Will return a deeopopy of this object. More... | |
virtual std::string | GetAsOsString () const =0 |
Will return a string suitable for an std::ostream. More... | |
DATA_TYPE | GetDataType () const |
Will return the data type of this value. More... | |
virtual long long int | GetInt64 () const =0 |
Will attempt to return the integer data (long long) More... | |
virtual int | GetInt32 () const =0 |
Will attempt to return the integer data (int) More... | |
virtual long double | GetFloat64 () const =0 |
Will attempt to return the floating-point data (long double) More... | |
virtual double | GetFloat32 () const =0 |
Will attempt to return the floating-point data (double) More... | |
virtual std::string | GetString () const =0 |
Will attempt to return the string-data. More... | |
virtual const std::vector< Value * > & | GetList () const =0 |
Will attempt to return the list-data. More... | |
+Additional Inherited Members | |
![]() | |
Value (DATA_TYPE type) | |
![]() | |
DATA_TYPE | type |
Specializations for string values (uses std::string)
+ +Definition at line 9 of file StringValue.h.
+StringValue::StringValue | +( | +const std::string & | +value | ) | ++ |
Definition at line 7 of file StringValue.cpp.
+
+
|
+ +inlineoverride | +
Definition at line 13 of file StringValue.h.
+
+
|
+ +overridevirtual | +
Will return a deeopopy of this object.
+ +Implements Hazelnp::Value.
+ +Definition at line 15 of file StringValue.cpp.
+
+
|
+ +overridevirtual | +
Will return a string suitable for an std::ostream;.
+ +Implements Hazelnp::Value.
+ +Definition at line 20 of file StringValue.cpp.
+
+
|
+ +overridevirtual | +
Throws HazelnuppValueNotConvertibleException.
+ +Implements Hazelnp::Value.
+ +Definition at line 54 of file StringValue.cpp.
+
+
|
+ +overridevirtual | +
Throws HazelnuppValueNotConvertibleException.
+ +Implements Hazelnp::Value.
+ +Definition at line 49 of file StringValue.cpp.
+ +
+
|
+ +overridevirtual | +
Throws HazelnuppValueNotConvertibleException.
+ +Implements Hazelnp::Value.
+ +Definition at line 44 of file StringValue.cpp.
+ +
+
|
+ +overridevirtual | +
Throws HazelnuppValueNotConvertibleException.
+ +Implements Hazelnp::Value.
+ +Definition at line 39 of file StringValue.cpp.
+ +
+
|
+ +overridevirtual | +
Throws HazelnuppValueNotConvertibleException.
+ +Implements Hazelnp::Value.
+ +Definition at line 64 of file StringValue.cpp.
+ +
+
|
+ +overridevirtual | +
Will return this value as a string.
+ +Implements Hazelnp::Value.
+ +Definition at line 59 of file StringValue.cpp.
+const std::string & StringValue::GetValue | +( | +) | +const | +
Will return the raw value.
+ +Definition at line 27 of file StringValue.cpp.
+StringValue::operator std::string | +( | +) | +const | +
Definition at line 32 of file StringValue.cpp.
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
This is the complete list of members for Hazelnp::Value, including all inherited members.
+Deepcopy() const =0 | Hazelnp::Value | pure virtual |
GetAsOsString() const =0 | Hazelnp::Value | pure virtual |
GetDataType() const | Hazelnp::Value | |
GetFloat32() const =0 | Hazelnp::Value | pure virtual |
GetFloat64() const =0 | Hazelnp::Value | pure virtual |
GetInt32() const =0 | Hazelnp::Value | pure virtual |
GetInt64() const =0 | Hazelnp::Value | pure virtual |
GetList() const =0 | Hazelnp::Value | pure virtual |
GetString() const =0 | Hazelnp::Value | pure virtual |
operator<< | Hazelnp::Value | friend |
type | Hazelnp::Value | protected |
Value(DATA_TYPE type) | Hazelnp::Value | protected |
~Value() | Hazelnp::Value | inlinevirtual |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
Abstract class for values. + More...
+ +#include <Value.h>
+Public Member Functions | |
virtual | ~Value () |
virtual Value * | Deepcopy () const =0 |
Will return a deeopopy of this object. More... | |
virtual std::string | GetAsOsString () const =0 |
Will return a string suitable for an std::ostream. More... | |
DATA_TYPE | GetDataType () const |
Will return the data type of this value. More... | |
virtual long long int | GetInt64 () const =0 |
Will attempt to return the integer data (long long) More... | |
virtual int | GetInt32 () const =0 |
Will attempt to return the integer data (int) More... | |
virtual long double | GetFloat64 () const =0 |
Will attempt to return the floating-point data (long double) More... | |
virtual double | GetFloat32 () const =0 |
Will attempt to return the floating-point data (double) More... | |
virtual std::string | GetString () const =0 |
Will attempt to return the string-data. More... | |
virtual const std::vector< Value * > & | GetList () const =0 |
Will attempt to return the list-data. More... | |
+Protected Member Functions | |
Value (DATA_TYPE type) | |
+Protected Attributes | |
DATA_TYPE | type |
+Friends | |
std::ostream & | operator<< (std::ostream &os, const Value &v) |
+
|
+ +inlinevirtual | +
+
|
+ +protected | +
+
|
+ +pure virtual | +
Will return a deeopopy of this object.
+ +Implemented in Hazelnp::FloatValue, Hazelnp::IntValue, Hazelnp::ListValue, Hazelnp::StringValue, and Hazelnp::VoidValue.
+ +
+
|
+ +pure virtual | +
Will return a string suitable for an std::ostream.
+ +Implemented in Hazelnp::FloatValue, Hazelnp::IntValue, Hazelnp::ListValue, Hazelnp::StringValue, and Hazelnp::VoidValue.
+ +DATA_TYPE Value::GetDataType | +( | +) | +const | +
+
|
+ +pure virtual | +
Will attempt to return the floating-point data (double)
+ +Implemented in Hazelnp::FloatValue, Hazelnp::IntValue, Hazelnp::ListValue, Hazelnp::StringValue, and Hazelnp::VoidValue.
+ +
+
|
+ +pure virtual | +
Will attempt to return the floating-point data (long double)
+ +Implemented in Hazelnp::FloatValue, Hazelnp::IntValue, Hazelnp::ListValue, Hazelnp::StringValue, and Hazelnp::VoidValue.
+ +
+
|
+ +pure virtual | +
Will attempt to return the integer data (int)
+ +Implemented in Hazelnp::FloatValue, Hazelnp::IntValue, Hazelnp::ListValue, Hazelnp::StringValue, and Hazelnp::VoidValue.
+ +
+
|
+ +pure virtual | +
Will attempt to return the integer data (long long)
+ +Implemented in Hazelnp::FloatValue, Hazelnp::IntValue, Hazelnp::ListValue, Hazelnp::StringValue, and Hazelnp::VoidValue.
+ +
+
|
+ +pure virtual | +
Will attempt to return the list-data.
+ +Implemented in Hazelnp::FloatValue, Hazelnp::IntValue, Hazelnp::ListValue, Hazelnp::StringValue, and Hazelnp::VoidValue.
+ +
+
|
+ +pure virtual | +
Will attempt to return the string-data.
+ +Implemented in Hazelnp::FloatValue, Hazelnp::IntValue, Hazelnp::ListValue, Hazelnp::StringValue, and Hazelnp::VoidValue.
+ +
+
|
+ +friend | +
+
|
+ +protected | +
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
This is the complete list of members for Hazelnp::VoidValue, including all inherited members.
+Deepcopy() const override | Hazelnp::VoidValue | virtual |
GetAsOsString() const override | Hazelnp::VoidValue | virtual |
GetDataType() const | Hazelnp::Value | |
GetFloat32() const override | Hazelnp::VoidValue | virtual |
GetFloat64() const override | Hazelnp::VoidValue | virtual |
GetInt32() const override | Hazelnp::VoidValue | virtual |
GetInt64() const override | Hazelnp::VoidValue | virtual |
GetList() const override | Hazelnp::VoidValue | virtual |
GetString() const override | Hazelnp::VoidValue | virtual |
type | Hazelnp::Value | protected |
Value(DATA_TYPE type) | Hazelnp::Value | protected |
VoidValue() | Hazelnp::VoidValue | |
~Value() | Hazelnp::Value | inlinevirtual |
~VoidValue() override | Hazelnp::VoidValue | inline |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
Specializations for void values. + More...
+ +#include <VoidValue.h>
+Public Member Functions | |
VoidValue () | |
~VoidValue () override | |
Value * | Deepcopy () const override |
Will return a deeopopy of this object. More... | |
std::string | GetAsOsString () const override |
Will return a string suitable for an std::ostream;. More... | |
long long int | GetInt64 () const override |
Throws HazelnuppValueNotConvertibleException. More... | |
int | GetInt32 () const override |
Throws HazelnuppValueNotConvertibleException. More... | |
long double | GetFloat64 () const override |
Throws HazelnuppValueNotConvertibleException. More... | |
double | GetFloat32 () const override |
Throws HazelnuppValueNotConvertibleException. More... | |
std::string | GetString () const override |
Returns an empty string. More... | |
const std::vector< Value * > & | GetList () const override |
Returns an empty list. More... | |
![]() | |
virtual | ~Value () |
virtual Value * | Deepcopy () const =0 |
Will return a deeopopy of this object. More... | |
virtual std::string | GetAsOsString () const =0 |
Will return a string suitable for an std::ostream. More... | |
DATA_TYPE | GetDataType () const |
Will return the data type of this value. More... | |
virtual long long int | GetInt64 () const =0 |
Will attempt to return the integer data (long long) More... | |
virtual int | GetInt32 () const =0 |
Will attempt to return the integer data (int) More... | |
virtual long double | GetFloat64 () const =0 |
Will attempt to return the floating-point data (long double) More... | |
virtual double | GetFloat32 () const =0 |
Will attempt to return the floating-point data (double) More... | |
virtual std::string | GetString () const =0 |
Will attempt to return the string-data. More... | |
virtual const std::vector< Value * > & | GetList () const =0 |
Will attempt to return the list-data. More... | |
+Additional Inherited Members | |
![]() | |
Value (DATA_TYPE type) | |
![]() | |
DATA_TYPE | type |
Specializations for void values.
+These house no value whatsoever, but only communicate information by merely existing.
+ +Definition at line 8 of file VoidValue.h.
+VoidValue::VoidValue | +( | +) | ++ |
Definition at line 6 of file VoidValue.cpp.
+
+
|
+ +inlineoverride | +
Definition at line 12 of file VoidValue.h.
+
+
|
+ +overridevirtual | +
Will return a deeopopy of this object.
+ +Implements Hazelnp::Value.
+ +Definition at line 13 of file VoidValue.cpp.
+
+
|
+ +overridevirtual | +
Will return a string suitable for an std::ostream;.
+ +Implements Hazelnp::Value.
+ +Definition at line 18 of file VoidValue.cpp.
+
+
|
+ +overridevirtual | +
Throws HazelnuppValueNotConvertibleException.
+ +Implements Hazelnp::Value.
+ +Definition at line 40 of file VoidValue.cpp.
+
+
|
+ +overridevirtual | +
Throws HazelnuppValueNotConvertibleException.
+ +Implements Hazelnp::Value.
+ +Definition at line 35 of file VoidValue.cpp.
+ +
+
|
+ +overridevirtual | +
Throws HazelnuppValueNotConvertibleException.
+ +Implements Hazelnp::Value.
+ +Definition at line 30 of file VoidValue.cpp.
+ +
+
|
+ +overridevirtual | +
Throws HazelnuppValueNotConvertibleException.
+ +Implements Hazelnp::Value.
+ +Definition at line 25 of file VoidValue.cpp.
+ +
+
|
+ +overridevirtual | +
Returns an empty list.
+ +Implements Hazelnp::Value.
+ +Definition at line 50 of file VoidValue.cpp.
+
+
|
+ +overridevirtual | +
Returns an empty string.
+ +Implements Hazelnp::Value.
+ +Definition at line 45 of file VoidValue.cpp.
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+Files | |
file | CmdArgsInterface.h [code] |
file | DataType.h [code] |
file | FloatValue.h [code] |
file | HazelnuppException.h [code] |
file | IntValue.h [code] |
file | ListValue.h [code] |
file | ParamConstraint.h [code] |
file | Parameter.h [code] |
file | Placeholders.h [code] |
file | StringTools.h [code] |
file | StringValue.h [code] |
file | Value.h [code] |
file | Version.h [code] |
file | VoidValue.h [code] |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+Files | |
file | CmdArgsInterface.cpp [code] |
file | FloatValue.cpp [code] |
file | IntValue.cpp [code] |
file | ListValue.cpp [code] |
file | Parameter.cpp [code] |
file | StringTools.cpp [code] |
file | StringValue.cpp [code] |
file | Value.cpp [code] |
file | VoidValue.cpp [code] |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+Directories | |
directory | Hazelnupp |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
doxygen | |
▼ include | |
▼ Hazelnupp | |
CmdArgsInterface.h | |
DataType.h | |
FloatValue.h | |
HazelnuppException.h | |
IntValue.h | |
ListValue.h | |
ParamConstraint.h | |
Parameter.h | |
Placeholders.h | |
StringTools.h | |
StringValue.h | |
Value.h | |
Version.h | |
VoidValue.h | |
▼ src | |
CmdArgsInterface.cpp | |
FloatValue.cpp | |
IntValue.cpp | |
ListValue.cpp | |
Parameter.cpp | |
StringTools.cpp | |
StringValue.cpp | |
Value.cpp | |
VoidValue.cpp |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
This page explains how to interpret the graphs that are generated by doxygen.
+Consider the following example:
This will result in the following graph:
+The boxes in the above graph have the following meaning:
+The arrows have the following meaning:
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
CHazelnp::CmdArgsInterface | The main class to interface with |
▼Cstd::exception | STL class |
▼CHazelnp::HazelnuppException | Generic hazelnupp exception |
▼CHazelnp::HazelnuppConstraintException | Gets thrown something bad happens because of parameter constraints |
CHazelnp::HazelnuppConstraintIncompatibleParameters | Gets thrown when a parameter constrained to be incompatible with other parameters gets supplied alongside at least one of those incompatible ones |
CHazelnp::HazelnuppConstraintMissingValue | Gets thrown when a parameter constrained to be required is not provided, and has no default value set |
CHazelnp::HazelnuppConstraintTypeMissmatch | Gets thrown when a parameter is of a type that does not match the required type, and is not convertible to it |
CHazelnp::HazelnuppInvalidKeyException | Gets thrown when an non-existent key gets dereferenced |
CHazelnp::HazelnuppValueNotConvertibleException | Gets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not convertible |
CHazelnp::ParamConstraint | |
CHazelnp::Parameter | |
CHazelnp::Internal::StringTools | Internal helper class |
▼CHazelnp::Value | Abstract class for values |
CHazelnp::FloatValue | Specializations for floating point values (uses long double) |
CHazelnp::IntValue | Specializations for integer values (uses long long int) |
CHazelnp::ListValue | Specializations for list values (uses std::vector<Value*>) |
CHazelnp::StringValue | Specializations for string values (uses std::string) |
CHazelnp::VoidValue | Specializations for void values |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
is a simple, easy to use command line parameter parser.
+ Hazelnupp does not support windows-, or bsd-style arguments. Only linux-style.
+
What is the linux-style? This:
These examples reference exceptions. These are not enabled by default. The default behaviour for user-fault exceptions is to produce output to stderr
and kill the process.
+ To enable exceptions, call this method:
+
++How do i actually import this into my existing project?
+
Super easily! Just grab the latest files (2) from /INCLUDE and put them into your project! You may have to add the .cpp to your compile list, but most IDEs should do this automatically.
++
The concept is that each parameter must be one of five types. These are:
Here are examples on how to create them
These parameters can then be accessed via a simple lookup!
++
So what's the simplest way to use Hazelnupp to work with command-line parameters? See:
Looks super easy! But what about actual values?
What about lists?
+
Abbreviations are a very important part of command line arguments. Like, typing -f
instead of --force
. Here's how to use them in Hazelnupp:
+
++That's all cool and stuff, but this looks like a LOT of error-checking and not elegant at all! How would i actually use this?
+
For exactly this reason, there are constraints. With this, you can control what your data looks like! Constraints serve three main purposes:
+With ParamConstraint::Require()
you can declare that a paramater must either always be present, or provide a default value.
+
Minimal working example:
With type safety you can always be certain that you are working with the correct type!
+ By creating a type-constraint, you force Hazelnupp to use a certain type.
+ If a supplied type does not match, but is convertible, it will be converted.
+ If it is not convertible, the process will terminate with a descriptive error message.
These conversions are:
The conversions *->list
just create a list with a single entry (except for void->list
which produces an empty list).
+ The *->void
conversions just drop their value.
+ void->string
just produces an empty string.
Minimal working example:
If --this-must-be-int
would be passed as a float, it would be converted to int. If it was passed, for example, as a string, it would throw an exception.
With parameter incompatibilities you can declare that certain parameters are just incompatible.
+ If they get passed together, the process will terminate with a descriptive error message.
Minimal working example:
Keep in mind that you can only register ONE constraint for each parameter! Adding another one will just overwrite the prior one. However, one constraint can do all three "types" at once if you daisychain them:
+
Hazelnupp does automatically create a parameter documentation, accessible via --help
.
+ If you want to use --help
yourself, just turn it off.
What does this automatically generated documentation look like?
This documentation is automatically fed by any information provided on parameters.
+ You have to set the brief descriptions yourself though.
Additionally you can provide a brief description of your application to be added right above the parameter list.
If you want to display this information somewhere else, you can always access it as a string via args.GenerateDocumentation()
.
+
Given that you did not disable crash-on-error, Hazelnupps default behaviour on user error is to terminate the process with a descriptive error message to stderr.
+Here's how they look like:
+Type mismatch:
Missing required parameter:
This assumes that you've set a description for, in this example, --width
. If a description is not set, the last line will simply be omitted.
+
Check out the tests! They may help you out!
+ Also make sure to check out the doxygen docs!
+
Chaining abbreviated parameters, like this:
Using parameters multiple times
+
This is still in alpha! There is no guarantee at all that this actually works.
+ Whilst i did my best to make sure it does, i bet there are still a few flaws i've overlooked.
+ Please know that i am not obliged to work on fixes. I do have other stuff to do. This does not mean that i won't, but i'm not sure when.
+ Feel free to submit a PR if you think you improved it in any way :)
+
If you want to contribute, feel free to fork the repository, and submit a pull request.
+ Bugfixes and tests are almost certain to be accepted, features should be agreed upon and come with tests.
+ Just create an issue with the tag feature request
. Don't forget to update the UML (Hazelnupp.vpp
)! The (free) modelling software used is Visual Paradigm.
+
Any code added must match the existing style!
/** */
for doxygen. See existing classifiers//!
for doxygen. See existing definitions{
always gets a new lineusing namespace std
using namespace Hazelnp
in cpp files. Don't do Hazelnp::
if possible#include <>
. Not ""
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+Namespaces | |
namespace | Internal |
namespace | Placeholders |
+Classes | |
class | CmdArgsInterface |
The main class to interface with. More... | |
class | FloatValue |
Specializations for floating point values (uses long double) More... | |
class | HazelnuppConstraintException |
Gets thrown something bad happens because of parameter constraints. More... | |
class | HazelnuppConstraintIncompatibleParameters |
Gets thrown when a parameter constrained to be incompatible with other parameters gets supplied alongside at least one of those incompatible ones. More... | |
class | HazelnuppConstraintMissingValue |
Gets thrown when a parameter constrained to be required is not provided, and has no default value set. More... | |
class | HazelnuppConstraintTypeMissmatch |
Gets thrown when a parameter is of a type that does not match the required type, and is not convertible to it. More... | |
class | HazelnuppException |
Generic hazelnupp exception. More... | |
class | HazelnuppInvalidKeyException |
Gets thrown when an non-existent key gets dereferenced. More... | |
class | HazelnuppValueNotConvertibleException |
Gets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not convertible. More... | |
class | IntValue |
Specializations for integer values (uses long long int) More... | |
class | ListValue |
Specializations for list values (uses std::vector<Value*>) More... | |
struct | ParamConstraint |
class | Parameter |
class | StringValue |
Specializations for string values (uses std::string) More... | |
class | Value |
Abstract class for values. More... | |
class | VoidValue |
Specializations for void values. More... | |
+Enumerations | |
enum class | DATA_TYPE { + VOID +, INT +, FLOAT +, STRING +, + LIST + + } |
The different data types a paramater can be. More... | |
+Functions | |
static std::string | DataTypeToString (DATA_TYPE type) |
+
|
+ +strong | +
+
|
+ +inlinestatic | +
Definition at line 17 of file DataType.h.
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+Classes | |
class | StringTools |
Internal helper class. More... | |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+Variables | |
static const std::string | g_emptyString |
The only purpose of this is to provide the ability to return an empty string as an error for std::string& methods. More... | |
+
|
+ +static | +
The only purpose of this is to provide the ability to return an empty string as an error for std::string& methods.
+ +Definition at line 9 of file Placeholders.h.
+ +
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
▼NHazelnp | |
▼NInternal | |
CStringTools | Internal helper class |
NPlaceholders | |
CCmdArgsInterface | The main class to interface with |
CFloatValue | Specializations for floating point values (uses long double) |
CHazelnuppConstraintException | Gets thrown something bad happens because of parameter constraints |
CHazelnuppConstraintIncompatibleParameters | Gets thrown when a parameter constrained to be incompatible with other parameters gets supplied alongside at least one of those incompatible ones |
CHazelnuppConstraintMissingValue | Gets thrown when a parameter constrained to be required is not provided, and has no default value set |
CHazelnuppConstraintTypeMissmatch | Gets thrown when a parameter is of a type that does not match the required type, and is not convertible to it |
CHazelnuppException | Generic hazelnupp exception |
CHazelnuppInvalidKeyException | Gets thrown when an non-existent key gets dereferenced |
CHazelnuppValueNotConvertibleException | Gets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not convertible |
CIntValue | Specializations for integer values (uses long long int) |
CListValue | Specializations for list values (uses std::vector<Value*>) |
CParamConstraint | |
CParameter | |
CStringValue | Specializations for string values (uses std::string) |
CValue | Abstract class for values |
CVoidValue | Specializations for void values |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
This is the complete list of members for Hazelnp::ParamConstraint, including all inherited members.
+AddIncompatibilities(const std::string &incompatibleParameters) | Hazelnp::ParamConstraint | inline |
AddIncompatibilities(const std::initializer_list< std::string > &incompatibleParameters) | Hazelnp::ParamConstraint | inline |
AddRequire(const std::initializer_list< std::string > &defaultValue={}, bool required=true) | Hazelnp::ParamConstraint | inline |
AddTypeSafety(DATA_TYPE requiredType, bool constrainType=true) | Hazelnp::ParamConstraint | inline |
CmdArgsInterface | Hazelnp::ParamConstraint | friend |
constrainType | Hazelnp::ParamConstraint | |
defaultValue | Hazelnp::ParamConstraint | |
Incompatibility(const std::initializer_list< std::string > &incompatibleParameters) | Hazelnp::ParamConstraint | inlinestatic |
Incompatibility(const std::string &incompatibleParameters) | Hazelnp::ParamConstraint | inlinestatic |
incompatibleParameters | Hazelnp::ParamConstraint | |
ParamConstraint()=default | Hazelnp::ParamConstraint | |
ParamConstraint(bool constrainType, DATA_TYPE requiredType, const std::initializer_list< std::string > &defaultValue, bool required, const std::initializer_list< std::string > &incompatibleParameters) | Hazelnp::ParamConstraint | inline |
Require(const std::initializer_list< std::string > &defaultValue={}, bool required=true) | Hazelnp::ParamConstraint | inlinestatic |
required | Hazelnp::ParamConstraint | |
requiredType | Hazelnp::ParamConstraint | |
TypeSafety(DATA_TYPE requiredType, bool constrainType=true) | Hazelnp::ParamConstraint | inlinestatic |
+ Leonetienne/Hazelnupp
+
+ Simple, easy to use, command line parameter interface
+ |
+
#include <ParamConstraint.h>
+Public Member Functions | |
ParamConstraint ()=default | |
Empty constructor. More... | |
ParamConstraint | AddRequire (const std::initializer_list< std::string > &defaultValue={}, bool required=true) |
Daisychain-method. More... | |
ParamConstraint | AddTypeSafety (DATA_TYPE requiredType, bool constrainType=true) |
Daisychain-method. More... | |
ParamConstraint | AddIncompatibilities (const std::string &incompatibleParameters) |
Daisychain-method. More... | |
ParamConstraint | AddIncompatibilities (const std::initializer_list< std::string > &incompatibleParameters) |
Daisychain-method. More... | |
ParamConstraint (bool constrainType, DATA_TYPE requiredType, const std::initializer_list< std::string > &defaultValue, bool required, const std::initializer_list< std::string > &incompatibleParameters) | |
Whole constructor. More... | |
+Static Public Member Functions | |
static ParamConstraint | Require (const std::initializer_list< std::string > &defaultValue={}, bool required=true) |
Constructs a require constraint. More... | |
static ParamConstraint | TypeSafety (DATA_TYPE requiredType, bool constrainType=true) |
Constructs a type-safety constraint. More... | |
static ParamConstraint | Incompatibility (const std::initializer_list< std::string > &incompatibleParameters) |
Constructs an incompatibility constraint. More... | |
static ParamConstraint | Incompatibility (const std::string &incompatibleParameters) |
Constructs an incompatibility constraint. More... | |
+Public Attributes | |
bool | constrainType = false |
Should this parameter be forced to be of a certain type? + Remember to set constrainTo to the wanted type. More... | |
DATA_TYPE | requiredType = DATA_TYPE::VOID |
Constrain the parameter to this value. Requires constrainType to be set to true. More... | |
std::vector< std::string > | defaultValue |
The default value for this parameter. More... | |
bool | required = false |
If set to true, and no default value set, an error will be produced if this parameter is not supplied by the user. More... | |
std::vector< std::string > | incompatibleParameters |
Parameters that are incompatible with this parameter. More... | |
+Friends | |
class | CmdArgsInterface |
Definition at line 8 of file ParamConstraint.h.
+
+
|
+ +default | +
Empty constructor.
+ +
+
|
+ +inline | +
Whole constructor.
+ +Definition at line 100 of file ParamConstraint.h.
+
+
|
+ +inline | +
Daisychain-method.
+Will add a the "incompatiblity" aspect.
+ This means, that the following parameters are NOT compatible with this one and will throw an error if passed together.
Definition at line 91 of file ParamConstraint.h.
+ +
+
|
+ +inline | +
Daisychain-method.
+Will add a the "incompatiblity" aspect.
+ This means, that the following parameters are NOT compatible with this one and will throw an error if passed together. Syntactical-sugar proxy method that will convert the lonely string to an initializer list for you :3
Definition at line 81 of file ParamConstraint.h.
+ +
+
|
+ +inline | +
Daisychain-method.
+Will add a the "required-argument" aspect.
+ Think of the default value like of a list ofparameters. Like {"--width", "800"}
Definition at line 27 of file ParamConstraint.h.
+
+
|
+ +inline | +
Daisychain-method.
+Will add a the "type-safety" aspect.
+ Constructs a type-safety constraint
Definition at line 48 of file ParamConstraint.h.
+
+
|
+ +inlinestatic | +
Constructs an incompatibility constraint.
+This means, that the following parameters are NOT compatible with this one and will throw an error if passed together
+ +Definition at line 59 of file ParamConstraint.h.
+
+
|
+ +inlinestatic | +
Constructs an incompatibility constraint.
+This means, that the following parameters are NOT compatible with this one and will throw an error if passed together. Syntactical-sugar proxy method that will convert the lonely string to an initializer list for you :3
+ +Definition at line 70 of file ParamConstraint.h.
+
+
|
+ +inlinestatic | +
Constructs a require constraint.
+
+ Think of the default value like of a list ofparameters. Like {"--width", "800"}
Definition at line 16 of file ParamConstraint.h.
+
+
|
+ +inlinestatic | +
Constructs a type-safety constraint.
+ +Definition at line 37 of file ParamConstraint.h.
+
+
|
+ +friend | +
Definition at line 135 of file ParamConstraint.h.
+ +bool Hazelnp::ParamConstraint::constrainType = false | +
Should this parameter be forced to be of a certain type?
+ Remember to set constrainTo
to the wanted type.
Definition at line 113 of file ParamConstraint.h.
+ +std::vector<std::string> Hazelnp::ParamConstraint::defaultValue | +
The default value for this parameter.
+
+ Gets applied if this parameter was not given.
+ Think of this like a list of parameters. Like {"--width", "800"}
Definition at line 121 of file ParamConstraint.h.
+ +std::vector<std::string> Hazelnp::ParamConstraint::incompatibleParameters | +
Parameters that are incompatible with this parameter.
+ +Definition at line 128 of file ParamConstraint.h.
+ +bool Hazelnp::ParamConstraint::required = false | +
If set to true, and no default value set, an error will be produced if this parameter is not supplied by the user.
+ +Definition at line 125 of file ParamConstraint.h.
+ +DATA_TYPE Hazelnp::ParamConstraint::requiredType = DATA_TYPE::VOID | +
Constrain the parameter to this value. Requires constrainType
to be set to true.
Definition at line 116 of file ParamConstraint.h.
+ +