diff --git a/docs/CmdArgsInterface_8cpp.html b/docs/CmdArgsInterface_8cpp.html index 9533ba5..ecd3961 100644 --- a/docs/CmdArgsInterface_8cpp.html +++ b/docs/CmdArgsInterface_8cpp.html @@ -124,7 +124,7 @@ Include dependency graph for CmdArgsInterface.cpp: diff --git a/docs/CmdArgsInterface_8cpp_source.html b/docs/CmdArgsInterface_8cpp_source.html index 9e161d8..958357d 100644 --- a/docs/CmdArgsInterface_8cpp_source.html +++ b/docs/CmdArgsInterface_8cpp_source.html @@ -323,7 +323,7 @@ $(function() {
243  const std::string& val = values[0];
244 
245  // String
-
246  if (!StringTools::IsNumeric(val, true))
+
246  if (!Internal::StringTools::IsNumeric(val, true))
247  {
248  rawInputType = DATA_TYPE::STRING;
249 
@@ -365,7 +365,7 @@ $(function() {
285  bool isInt;
286  long double num;
287 
-
288  if (StringTools::ParseNumber(val, isInt, num))
+
288  if (Internal::StringTools::ParseNumber(val, isInt, num))
289  {
290  rawInputType = isInt ? DATA_TYPE::INT : DATA_TYPE::FLOAT;
291 
@@ -708,9 +708,7 @@ $(function() {
HazelnuppException.h
Hazelnp
Definition: CmdArgsInterface.h:7
Hazelnp::IntValue
Specializations for integer values (uses long long int)
Definition: IntValue.h:8
-
Hazelnp::StringTools::IsNumeric
static bool IsNumeric(const std::string &str, const bool allowDecimalPoint=false)
Will return true if the given string consists only of digits (including signage)
Definition: StringTools.cpp:56
Hazelnp::CmdArgsInterface::GetConstraint
ParamConstraint GetConstraint(const std::string &parameter) const
Will return the constraint information for a specific parameter.
Definition: CmdArgsInterface.cpp:542
-
Hazelnp::StringTools::ParseNumber
static bool ParseNumber(const std::string &str, bool &out_isInt, long double &out_number)
Will convert the number in str to a number.
Definition: StringTools.cpp:82
Hazelnp::CmdArgsInterface::ClearAbbreviations
void ClearAbbreviations()
Will delete all abbreviations.
Definition: CmdArgsInterface.cpp:592
Hazelnp::CmdArgsInterface::SetCatchHelp
void SetCatchHelp(bool catchHelp)
Sets whether the CmdArgsInterface should automatically catch the –help parameter, print the parameter...
Definition: CmdArgsInterface.cpp:334
Hazelnp::CmdArgsInterface::HasAbbreviation
bool HasAbbreviation(const std::string &abbrev) const
Will check wether or not an abbreviation is registered.
Definition: CmdArgsInterface.cpp:581
@@ -753,6 +751,7 @@ $(function() {
Hazelnp::VoidValue
Specializations for void values.
Definition: VoidValue.h:8
Hazelnp::CmdArgsInterface::GenerateDocumentation
std::string GenerateDocumentation() const
Will generate a text-based documentation suited to show the user, for example on –help.
Definition: CmdArgsInterface.cpp:391
Hazelnp::CmdArgsInterface::RegisterDescription
void RegisterDescription(const std::string &parameter, const std::string &description)
Willl register a short description for a parameter.
Definition: CmdArgsInterface.cpp:356
+
Hazelnp::Internal::StringTools::ParseNumber
static bool ParseNumber(const std::string &str, bool &out_isInt, long double &out_number)
Will convert the number in str to a number.
Definition: StringTools.cpp:82
Hazelnp::DATA_TYPE::FLOAT
@ FLOAT
Hazelnp::CmdArgsInterface::GetDescription
const std::string & GetDescription(const std::string &parameter) const
Will return a short description for a parameter, if it exists.
Definition: CmdArgsInterface.cpp:362
Hazelnp::DATA_TYPE::INT
@ INT
@@ -762,6 +761,7 @@ $(function() {
Hazelnp::DATA_TYPE::STRING
@ STRING
Hazelnp::CmdArgsInterface::GetExecutableName
const std::string & GetExecutableName() const
Will return argv[0], the name of the executable.
Definition: CmdArgsInterface.cpp:553
Hazelnp::DataTypeToString
static std::string DataTypeToString(DATA_TYPE type)
Definition: DataType.h:17
+
Hazelnp::Internal::StringTools::IsNumeric
static bool IsNumeric(const std::string &str, const bool allowDecimalPoint=false)
Will return true if the given string consists only of digits (including signage)
Definition: StringTools.cpp:56
Hazelnp::CmdArgsInterface::SetCrashOnFail
void SetCrashOnFail(bool crashOnFail)
Sets whether to crash the application, and print to stderr, when an exception is raised whilst parsin...
Definition: CmdArgsInterface.cpp:611
Hazelnp::ListValue
Specializations for list values (uses std::vector<Value*>)
Definition: ListValue.h:9
Hazelnp::StringValue
Specializations for string values (uses std::string)
Definition: StringValue.h:9
@@ -769,7 +769,7 @@ $(function() {
Hazelnp::CmdArgsInterface::~CmdArgsInterface
~CmdArgsInterface()
Definition: CmdArgsInterface.cpp:26
diff --git a/docs/CmdArgsInterface_8h.html b/docs/CmdArgsInterface_8h.html index 7130b15..f365594 100644 --- a/docs/CmdArgsInterface_8h.html +++ b/docs/CmdArgsInterface_8h.html @@ -127,7 +127,7 @@ Namespaces diff --git a/docs/CmdArgsInterface_8h_source.html b/docs/CmdArgsInterface_8h_source.html index 7836b53..c1ff68f 100644 --- a/docs/CmdArgsInterface_8h_source.html +++ b/docs/CmdArgsInterface_8h_source.html @@ -261,7 +261,7 @@ $(function() {
Hazelnp::CmdArgsInterface::~CmdArgsInterface
~CmdArgsInterface()
Definition: CmdArgsInterface.cpp:26
diff --git a/docs/DataType_8h.html b/docs/DataType_8h.html index 4836e67..17e3811 100644 --- a/docs/DataType_8h.html +++ b/docs/DataType_8h.html @@ -148,7 +148,7 @@ Functions diff --git a/docs/DataType_8h_source.html b/docs/DataType_8h_source.html index ac696ad..a6187f1 100644 --- a/docs/DataType_8h_source.html +++ b/docs/DataType_8h_source.html @@ -128,7 +128,7 @@ $(function() {
Hazelnp::DataTypeToString
static std::string DataTypeToString(DATA_TYPE type)
Definition: DataType.h:17
diff --git a/docs/Debug_2Hazelnupp_8vcxproj_8FileListAbsolute_8txt.html b/docs/Debug_2Hazelnupp_8vcxproj_8FileListAbsolute_8txt.html index 6503113..5557477 100644 --- a/docs/Debug_2Hazelnupp_8vcxproj_8FileListAbsolute_8txt.html +++ b/docs/Debug_2Hazelnupp_8vcxproj_8FileListAbsolute_8txt.html @@ -77,7 +77,7 @@ $(function() { diff --git a/docs/FloatValue_8cpp.html b/docs/FloatValue_8cpp.html index 21bcb8e..7fdc7d7 100644 --- a/docs/FloatValue_8cpp.html +++ b/docs/FloatValue_8cpp.html @@ -103,7 +103,7 @@ Include dependency graph for FloatValue.cpp: diff --git a/docs/FloatValue_8cpp_source.html b/docs/FloatValue_8cpp_source.html index 862d027..4ad52cd 100644 --- a/docs/FloatValue_8cpp_source.html +++ b/docs/FloatValue_8cpp_source.html @@ -173,7 +173,7 @@ $(function() {
Hazelnp::FloatValue::GetInt32
int GetInt32() const override
Will return the data as an int.
Definition: FloatValue.cpp:49
diff --git a/docs/FloatValue_8h.html b/docs/FloatValue_8h.html index f0e3966..6008583 100644 --- a/docs/FloatValue_8h.html +++ b/docs/FloatValue_8h.html @@ -123,7 +123,7 @@ Namespaces diff --git a/docs/FloatValue_8h_source.html b/docs/FloatValue_8h_source.html index f3e5724..e045c9f 100644 --- a/docs/FloatValue_8h_source.html +++ b/docs/FloatValue_8h_source.html @@ -142,7 +142,7 @@ $(function() {
Hazelnp::FloatValue::GetInt32
int GetInt32() const override
Will return the data as an int.
Definition: FloatValue.cpp:49
diff --git a/docs/HazelnuppException_8h.html b/docs/HazelnuppException_8h.html index 3d6e228..5f0a082 100644 --- a/docs/HazelnuppException_8h.html +++ b/docs/HazelnuppException_8h.html @@ -143,7 +143,7 @@ Namespaces diff --git a/docs/HazelnuppException_8h_source.html b/docs/HazelnuppException_8h_source.html index 3fa668c..d86014a 100644 --- a/docs/HazelnuppException_8h_source.html +++ b/docs/HazelnuppException_8h_source.html @@ -204,7 +204,7 @@ $(function() {
Hazelnp::HazelnuppInvalidKeyException::HazelnuppInvalidKeyException
HazelnuppInvalidKeyException()
Definition: HazelnuppException.h:32
diff --git a/docs/IntValue_8cpp.html b/docs/IntValue_8cpp.html index 936f8a7..e41ff97 100644 --- a/docs/IntValue_8cpp.html +++ b/docs/IntValue_8cpp.html @@ -103,7 +103,7 @@ Include dependency graph for IntValue.cpp: diff --git a/docs/IntValue_8cpp_source.html b/docs/IntValue_8cpp_source.html index 0b7cf96..bd6115c 100644 --- a/docs/IntValue_8cpp_source.html +++ b/docs/IntValue_8cpp_source.html @@ -173,7 +173,7 @@ $(function() {
Hazelnp::HazelnuppValueNotConvertibleException
Gets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not ...
Definition: HazelnuppException.h:38
diff --git a/docs/IntValue_8h.html b/docs/IntValue_8h.html index 6b4b22c..14aad36 100644 --- a/docs/IntValue_8h.html +++ b/docs/IntValue_8h.html @@ -122,7 +122,7 @@ Namespaces diff --git a/docs/IntValue_8h_source.html b/docs/IntValue_8h_source.html index 19d4cf0..4591c41 100644 --- a/docs/IntValue_8h_source.html +++ b/docs/IntValue_8h_source.html @@ -142,7 +142,7 @@ $(function() {
Value.h
diff --git a/docs/ListValue_8cpp.html b/docs/ListValue_8cpp.html index 0fd30ab..16ee4d5 100644 --- a/docs/ListValue_8cpp.html +++ b/docs/ListValue_8cpp.html @@ -103,7 +103,7 @@ Include dependency graph for ListValue.cpp: diff --git a/docs/ListValue_8cpp_source.html b/docs/ListValue_8cpp_source.html index 54f97fe..3dd95fb 100644 --- a/docs/ListValue_8cpp_source.html +++ b/docs/ListValue_8cpp_source.html @@ -199,7 +199,7 @@ $(function() {
Hazelnp::HazelnuppValueNotConvertibleException
Gets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not ...
Definition: HazelnuppException.h:38
diff --git a/docs/ListValue_8h.html b/docs/ListValue_8h.html index 4643375..9e7da07 100644 --- a/docs/ListValue_8h.html +++ b/docs/ListValue_8h.html @@ -123,7 +123,7 @@ Namespaces diff --git a/docs/ListValue_8h_source.html b/docs/ListValue_8h_source.html index d85fd7b..778ea05 100644 --- a/docs/ListValue_8h_source.html +++ b/docs/ListValue_8h_source.html @@ -145,7 +145,7 @@ $(function() {
Value.h
diff --git a/docs/ParamConstraint_8h.html b/docs/ParamConstraint_8h.html index b2e7959..c9118fe 100644 --- a/docs/ParamConstraint_8h.html +++ b/docs/ParamConstraint_8h.html @@ -121,7 +121,7 @@ Namespaces diff --git a/docs/ParamConstraint_8h_source.html b/docs/ParamConstraint_8h_source.html index 5efa29e..1857d54 100644 --- a/docs/ParamConstraint_8h_source.html +++ b/docs/ParamConstraint_8h_source.html @@ -164,7 +164,7 @@ $(function() {
Hazelnp::ParamConstraint::ParamConstraint
ParamConstraint(bool constrainType, DATA_TYPE requiredType, const std::vector< std::string > &defaultValue, bool required)
Whole constructor.
Definition: ParamConstraint.h:36
diff --git a/docs/Parameter_8cpp.html b/docs/Parameter_8cpp.html index b91f5c6..0f1f582 100644 --- a/docs/Parameter_8cpp.html +++ b/docs/Parameter_8cpp.html @@ -98,7 +98,7 @@ Include dependency graph for Parameter.cpp: diff --git a/docs/Parameter_8cpp_source.html b/docs/Parameter_8cpp_source.html index 5f8ae62..e292630 100644 --- a/docs/Parameter_8cpp_source.html +++ b/docs/Parameter_8cpp_source.html @@ -116,7 +116,7 @@ $(function() {
Parameter.h
diff --git a/docs/Parameter_8h.html b/docs/Parameter_8h.html index 64feea0..c3c696e 100644 --- a/docs/Parameter_8h.html +++ b/docs/Parameter_8h.html @@ -124,7 +124,7 @@ Namespaces diff --git a/docs/Parameter_8h_source.html b/docs/Parameter_8h_source.html index 8875de2..ba70fb8 100644 --- a/docs/Parameter_8h_source.html +++ b/docs/Parameter_8h_source.html @@ -119,7 +119,7 @@ $(function() {
Value.h
diff --git a/docs/Placeholders_8h.html b/docs/Placeholders_8h.html index 0176d5e..8cd5562 100644 --- a/docs/Placeholders_8h.html +++ b/docs/Placeholders_8h.html @@ -119,7 +119,7 @@ Variables diff --git a/docs/Placeholders_8h_source.html b/docs/Placeholders_8h_source.html index 02bfdda..5636f6c 100644 --- a/docs/Placeholders_8h_source.html +++ b/docs/Placeholders_8h_source.html @@ -94,7 +94,7 @@ $(function() {
Hazelnp::Placeholders::g_emptyString
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::str...
Definition: Placeholders.h:9
diff --git a/docs/Release_2Hazelnupp_8vcxproj_8FileListAbsolute_8txt.html b/docs/Release_2Hazelnupp_8vcxproj_8FileListAbsolute_8txt.html index e447a71..835a1fb 100644 --- a/docs/Release_2Hazelnupp_8vcxproj_8FileListAbsolute_8txt.html +++ b/docs/Release_2Hazelnupp_8vcxproj_8FileListAbsolute_8txt.html @@ -77,7 +77,7 @@ $(function() { diff --git a/docs/StringTools_8cpp.html b/docs/StringTools_8cpp.html index cee93f0..483a706 100644 --- a/docs/StringTools_8cpp.html +++ b/docs/StringTools_8cpp.html @@ -97,7 +97,7 @@ Include dependency graph for StringTools.cpp: diff --git a/docs/StringTools_8cpp_source.html b/docs/StringTools_8cpp_source.html index 91e94d7..77398f5 100644 --- a/docs/StringTools_8cpp_source.html +++ b/docs/StringTools_8cpp_source.html @@ -82,7 +82,7 @@ $(function() {
2 
3 using namespace Hazelnp;
4 
-
5 bool StringTools::Contains(const std::string& str, const char c)
+
5 bool Internal::StringTools::Contains(const std::string& str, const char c)
6 {
7  for (const char& i : str)
8  if (i == c)
@@ -91,7 +91,7 @@ $(function() {
11  return false;
12 }
13 
-
14 std::string StringTools::Replace(const std::string& str, const char find, const std::string& subst)
+
14 std::string Internal::StringTools::Replace(const std::string& str, const char find, const std::string& subst)
15 {
16  std::stringstream ss;
17 
@@ -104,7 +104,7 @@ $(function() {
24  return ss.str();
25 }
26 
-
27 std::string StringTools::Replace(const std::string& str, const std::string& find, const std::string& subst)
+
27 std::string Internal::StringTools::Replace(const std::string& str, const std::string& find, const std::string& subst)
28 {
29  if (find.length() == 0) return str;
30 
@@ -133,7 +133,7 @@ $(function() {
53 }
54 
55 
-
56 bool StringTools::IsNumeric(const std::string& str, const bool allowDecimalPoint)
+
56 bool Internal::StringTools::IsNumeric(const std::string& str, const bool allowDecimalPoint)
57 {
58  if (str.length() == 0) return false;
59 
@@ -159,12 +159,12 @@ $(function() {
79  return digitCount > 0;
80 }
81 
-
82 bool StringTools::ParseNumber(const std::string& str, bool& out_isInt, long double& out_number)
+
82 bool Internal::StringTools::ParseNumber(const std::string& str, bool& out_isInt, long double& out_number)
83 {
84  bool isDecimal = false;
85 
86  if (str.length() == 0) return false;
-
87  if (Contains(str, '.')) isDecimal = true;
+
87  if (Contains(str, '.')) isDecimal = true;
88 
89  if (isDecimal)
90  {
@@ -202,14 +202,14 @@ $(function() {
122  return true;
123 }
124 
-
125 std::vector<std::string> StringTools::SplitString(const std::string& str, const char delimiter)
+
125 std::vector<std::string> Internal::StringTools::SplitString(const std::string& str, const char delimiter)
126 {
127  if (str.length() == 0) return std::vector<std::string>();
128 
-
129  return SplitString(str, delimiter);
+
129  return SplitString(str, delimiter);
130 }
131 
-
132 std::vector<std::string> StringTools::SplitString(const std::string& str, const std::string& delimiter)
+
132 std::vector<std::string> Internal::StringTools::SplitString(const std::string& str, const std::string& delimiter)
133 {
134  if (str.length() == 0) return std::vector<std::string>();
135 
@@ -250,7 +250,7 @@ $(function() {
170  return parts;
171 }
172 
-
173 std::string StringTools::ToLower(const std::string& str)
+
173 std::string Internal::StringTools::ToLower(const std::string& str)
174 {
175  std::stringstream ss;
176  for (std::size_t i = 0; i < str.length(); i++)
@@ -265,17 +265,17 @@ $(function() {
185  return ss.str();
186 }
-
Hazelnp::StringTools::Replace
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.
Definition: StringTools.cpp:14
Hazelnp
Definition: CmdArgsInterface.h:7
-
Hazelnp::StringTools::IsNumeric
static bool IsNumeric(const std::string &str, const bool allowDecimalPoint=false)
Will return true if the given string consists only of digits (including signage)
Definition: StringTools.cpp:56
-
Hazelnp::StringTools::ParseNumber
static bool ParseNumber(const std::string &str, bool &out_isInt, long double &out_number)
Will convert the number in str to a number.
Definition: StringTools.cpp:82
-
Hazelnp::StringTools::Contains
static bool Contains(const std::string &str, const char c)
Will return wether or not a given char is in a string.
Definition: StringTools.cpp:5
-
Hazelnp::StringTools::SplitString
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!
Definition: StringTools.cpp:125
+
Hazelnp::Internal::StringTools::Contains
static bool Contains(const std::string &str, const char c)
Will return wether or not a given char is in a string.
Definition: StringTools.cpp:5
+
Hazelnp::Internal::StringTools::ToLower
static std::string ToLower(const std::string &str)
Will make a string all lower-case.
Definition: StringTools.cpp:173
+
Hazelnp::Internal::StringTools::Replace
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.
Definition: StringTools.cpp:14
+
Hazelnp::Internal::StringTools::ParseNumber
static bool ParseNumber(const std::string &str, bool &out_isInt, long double &out_number)
Will convert the number in str to a number.
Definition: StringTools.cpp:82
+
Hazelnp::Internal::StringTools::SplitString
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!
Definition: StringTools.cpp:125
+
Hazelnp::Internal::StringTools::IsNumeric
static bool IsNumeric(const std::string &str, const bool allowDecimalPoint=false)
Will return true if the given string consists only of digits (including signage)
Definition: StringTools.cpp:56
StringTools.h
-
Hazelnp::StringTools::ToLower
static std::string ToLower(const std::string &str)
Will make a string all lower-case.
Definition: StringTools.cpp:173
diff --git a/docs/StringTools_8h.html b/docs/StringTools_8h.html index 85d2003..1e80dac 100644 --- a/docs/StringTools_8h.html +++ b/docs/StringTools_8h.html @@ -112,19 +112,21 @@ This graph shows which files directly or indirectly include this file: - - + +

Classes

class  Hazelnp::StringTools
 Internal helper class. More...
class  Hazelnp::Internal::StringTools
 Internal helper class. More...
 
+ +

Namespaces

 Hazelnp
 
 Hazelnp::Internal
 
diff --git a/docs/StringTools_8h_source.html b/docs/StringTools_8h_source.html index 6784b13..9af49e8 100644 --- a/docs/StringTools_8h_source.html +++ b/docs/StringTools_8h_source.html @@ -85,51 +85,55 @@ $(function() {
5 #include <cmath>
6 
7 namespace Hazelnp
-
8 {
-
9  /** Internal helper class. Feel free to use it tho.
-
10  */
-
11  class StringTools
-
12  {
-
13  public:
-
14  //! Will return wether or not a given char is in a string
-
15  static bool Contains(const std::string& str, const char c);
-
16 
-
17  //! Will replace a part of a string with another string
-
18  static std::string Replace(const std::string& str, const char find, const std::string& subst);
-
19 
-
20  //! Will replace a part of a string with another string
-
21  static std::string Replace(const std::string& str, const std::string& find, const std::string& subst);
-
22 
-
23  //! Will return true if the given string consists only of digits (including signage)
-
24  static bool IsNumeric(const std::string& str, const bool allowDecimalPoint = false);
-
25 
-
26  //! Will convert the number in str to a number.
-
27  //! Returns wether or not the operation was successful.
-
28  //! Also returns wether the number is an integer, or floating point. If int, cast out_number to int.
-
29  static bool ParseNumber(const std::string& str, bool& out_isInt, long double& out_number);
-
30 
-
31  //! Will split a string by a delimiter char. The delimiter will be excluded!
-
32  static std::vector<std::string> SplitString(const std::string& str, const char delimiter);
-
33 
-
34  //! Will split a string by a delimiter string. The delimiter will be excluded!
-
35  static std::vector<std::string> SplitString(const std::string& str, const std::string& delimiter);
-
36 
-
37  //! Will make a string all lower-case
-
38  static std::string ToLower(const std::string& str);
-
39  };
-
40 }
+
8 {
+
9  namespace Internal
+
10  {
+
11  /** Internal helper class. Feel free to use it tho.
+
12  */
+
13  class StringTools
+
14  {
+
15  public:
+
16  //! Will return wether or not a given char is in a string
+
17  static bool Contains(const std::string& str, const char c);
+
18 
+
19  //! Will replace a part of a string with another string
+
20  static std::string Replace(const std::string& str, const char find, const std::string& subst);
+
21 
+
22  //! Will replace a part of a string with another string
+
23  static std::string Replace(const std::string& str, const std::string& find, const std::string& subst);
+
24 
+
25  //! Will return true if the given string consists only of digits (including signage)
+
26  static bool IsNumeric(const std::string& str, const bool allowDecimalPoint = false);
+
27 
+
28  //! Will convert the number in str to a number.
+
29  //! Returns wether or not the operation was successful.
+
30  //! Also returns wether the number is an integer, or floating point. If int, cast out_number to int.
+
31  static bool ParseNumber(const std::string& str, bool& out_isInt, long double& out_number);
+
32 
+
33  //! Will split a string by a delimiter char. The delimiter will be excluded!
+
34  static std::vector<std::string> SplitString(const std::string& str, const char delimiter);
+
35 
+
36  //! Will split a string by a delimiter string. The delimiter will be excluded!
+
37  static std::vector<std::string> SplitString(const std::string& str, const std::string& delimiter);
+
38 
+
39  //! Will make a string all lower-case
+
40  static std::string ToLower(const std::string& str);
+
41  };
+
42  }
+
43 }
+
44 
-
Hazelnp::StringTools::Replace
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.
Definition: StringTools.cpp:14
Hazelnp
Definition: CmdArgsInterface.h:7
-
Hazelnp::StringTools::IsNumeric
static bool IsNumeric(const std::string &str, const bool allowDecimalPoint=false)
Will return true if the given string consists only of digits (including signage)
Definition: StringTools.cpp:56
-
Hazelnp::StringTools::ParseNumber
static bool ParseNumber(const std::string &str, bool &out_isInt, long double &out_number)
Will convert the number in str to a number.
Definition: StringTools.cpp:82
-
Hazelnp::StringTools::Contains
static bool Contains(const std::string &str, const char c)
Will return wether or not a given char is in a string.
Definition: StringTools.cpp:5
-
Hazelnp::StringTools::SplitString
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!
Definition: StringTools.cpp:125
-
Hazelnp::StringTools
Internal helper class.
Definition: StringTools.h:11
-
Hazelnp::StringTools::ToLower
static std::string ToLower(const std::string &str)
Will make a string all lower-case.
Definition: StringTools.cpp:173
+
Hazelnp::Internal::StringTools::Contains
static bool Contains(const std::string &str, const char c)
Will return wether or not a given char is in a string.
Definition: StringTools.cpp:5
+
Hazelnp::Internal::StringTools::ToLower
static std::string ToLower(const std::string &str)
Will make a string all lower-case.
Definition: StringTools.cpp:173
+
Hazelnp::Internal::StringTools
Internal helper class.
Definition: StringTools.h:13
+
Hazelnp::Internal::StringTools::Replace
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.
Definition: StringTools.cpp:14
+
Hazelnp::Internal::StringTools::ParseNumber
static bool ParseNumber(const std::string &str, bool &out_isInt, long double &out_number)
Will convert the number in str to a number.
Definition: StringTools.cpp:82
+
Hazelnp::Internal::StringTools::SplitString
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!
Definition: StringTools.cpp:125
+
Hazelnp::Internal::StringTools::IsNumeric
static bool IsNumeric(const std::string &str, const bool allowDecimalPoint=false)
Will return true if the given string consists only of digits (including signage)
Definition: StringTools.cpp:56
diff --git a/docs/StringValue_8cpp.html b/docs/StringValue_8cpp.html index f81fe70..89bb8c9 100644 --- a/docs/StringValue_8cpp.html +++ b/docs/StringValue_8cpp.html @@ -103,7 +103,7 @@ Include dependency graph for StringValue.cpp: diff --git a/docs/StringValue_8cpp_source.html b/docs/StringValue_8cpp_source.html index 8eae356..ec50099 100644 --- a/docs/StringValue_8cpp_source.html +++ b/docs/StringValue_8cpp_source.html @@ -165,7 +165,7 @@ $(function() {
Hazelnp::HazelnuppValueNotConvertibleException
Gets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not ...
Definition: HazelnuppException.h:38
diff --git a/docs/StringValue_8h.html b/docs/StringValue_8h.html index 130a436..73c27d2 100644 --- a/docs/StringValue_8h.html +++ b/docs/StringValue_8h.html @@ -123,7 +123,7 @@ Namespaces diff --git a/docs/StringValue_8h_source.html b/docs/StringValue_8h_source.html index ea18200..87093e4 100644 --- a/docs/StringValue_8h_source.html +++ b/docs/StringValue_8h_source.html @@ -141,7 +141,7 @@ $(function() {
Value.h
diff --git a/docs/Value_8cpp.html b/docs/Value_8cpp.html index 4f77170..7cd94ed 100644 --- a/docs/Value_8cpp.html +++ b/docs/Value_8cpp.html @@ -97,7 +97,7 @@ Include dependency graph for Value.cpp: diff --git a/docs/Value_8cpp_source.html b/docs/Value_8cpp_source.html index 18e55cb..8cddbd0 100644 --- a/docs/Value_8cpp_source.html +++ b/docs/Value_8cpp_source.html @@ -102,7 +102,7 @@ $(function() {
Value.h
diff --git a/docs/Value_8h.html b/docs/Value_8h.html index d8662a5..97461e5 100644 --- a/docs/Value_8h.html +++ b/docs/Value_8h.html @@ -136,7 +136,7 @@ Namespaces diff --git a/docs/Value_8h_source.html b/docs/Value_8h_source.html index 3268be7..2a39fd1 100644 --- a/docs/Value_8h_source.html +++ b/docs/Value_8h_source.html @@ -148,7 +148,7 @@ $(function() {
Hazelnp::Value::GetFloat64
virtual long double GetFloat64() const =0
Will attempt to return the floating-point data (long double)
diff --git a/docs/VoidValue_8cpp.html b/docs/VoidValue_8cpp.html index 6ba7834..eb60109 100644 --- a/docs/VoidValue_8cpp.html +++ b/docs/VoidValue_8cpp.html @@ -102,7 +102,7 @@ Include dependency graph for VoidValue.cpp: diff --git a/docs/VoidValue_8cpp_source.html b/docs/VoidValue_8cpp_source.html index 1c1785c..782f759 100644 --- a/docs/VoidValue_8cpp_source.html +++ b/docs/VoidValue_8cpp_source.html @@ -151,7 +151,7 @@ $(function() {
Hazelnp::HazelnuppValueNotConvertibleException
Gets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not ...
Definition: HazelnuppException.h:38
diff --git a/docs/VoidValue_8h.html b/docs/VoidValue_8h.html index eda2c0e..37b30ff 100644 --- a/docs/VoidValue_8h.html +++ b/docs/VoidValue_8h.html @@ -122,7 +122,7 @@ Namespaces diff --git a/docs/VoidValue_8h_source.html b/docs/VoidValue_8h_source.html index c9c24b5..7c95c5e 100644 --- a/docs/VoidValue_8h_source.html +++ b/docs/VoidValue_8h_source.html @@ -131,7 +131,7 @@ $(function() {
Value.h
diff --git a/docs/annotated.html b/docs/annotated.html index 38c7ae1..f636bfa 100644 --- a/docs/annotated.html +++ b/docs/annotated.html @@ -75,30 +75,31 @@ $(function() {
Here are the classes, structs, unions and interfaces with brief descriptions:
-
[detail level 12]
+
[detail level 123]
- - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + +
 NHazelnp
 CCmdArgsInterfaceThe main class to interface with
 CFloatValueSpecializations for floating point values (uses long double)
 CHazelnuppConstraintExceptionGets thrown something bad happens because of parameter constraints
 CHazelnuppConstraintMissingValueGets thrown when a parameter constrained to be required is not provided, and has no default value set
 CHazelnuppConstraintTypeMissmatchGets thrown when a parameter is of a type that does not match the required type, and is not convertible to it
 CHazelnuppExceptionGeneric hazelnupp exception
 CHazelnuppInvalidKeyExceptionGets thrown when an non-existent key gets dereferenced
 CHazelnuppValueNotConvertibleExceptionGets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not convertible
 CIntValueSpecializations for integer values (uses long long int)
 CListValueSpecializations for list values (uses std::vector<Value*>)
 CParamConstraint
 CParameter
 CStringToolsInternal helper class
 CStringValueSpecializations for string values (uses std::string)
 CValueAbstract class for values
 CVoidValueSpecializations for void values
 NInternal
 CStringToolsInternal helper class
 CCmdArgsInterfaceThe main class to interface with
 CFloatValueSpecializations for floating point values (uses long double)
 CHazelnuppConstraintExceptionGets thrown something bad happens because of parameter constraints
 CHazelnuppConstraintMissingValueGets thrown when a parameter constrained to be required is not provided, and has no default value set
 CHazelnuppConstraintTypeMissmatchGets thrown when a parameter is of a type that does not match the required type, and is not convertible to it
 CHazelnuppExceptionGeneric hazelnupp exception
 CHazelnuppInvalidKeyExceptionGets thrown when an non-existent key gets dereferenced
 CHazelnuppValueNotConvertibleExceptionGets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not convertible
 CIntValueSpecializations for integer values (uses long long int)
 CListValueSpecializations for list values (uses std::vector<Value*>)
 CParamConstraint
 CParameter
 CStringValueSpecializations for string values (uses std::string)
 CValueAbstract class for values
 CVoidValueSpecializations for void values
diff --git a/docs/classHazelnp_1_1CmdArgsInterface-members.html b/docs/classHazelnp_1_1CmdArgsInterface-members.html index 8f236b1..c45ece5 100644 --- a/docs/classHazelnp_1_1CmdArgsInterface-members.html +++ b/docs/classHazelnp_1_1CmdArgsInterface-members.html @@ -112,7 +112,7 @@ $(function() { diff --git a/docs/classHazelnp_1_1CmdArgsInterface.html b/docs/classHazelnp_1_1CmdArgsInterface.html index cc86d5f..68ba37c 100644 --- a/docs/classHazelnp_1_1CmdArgsInterface.html +++ b/docs/classHazelnp_1_1CmdArgsInterface.html @@ -1142,7 +1142,7 @@ Public Member Functions
Hazelnp::DataTypeToString
static std::string DataTypeToString(DATA_TYPE type)
Definition: DataType.h:17
diff --git a/docs/classHazelnp_1_1FloatValue-members.html b/docs/classHazelnp_1_1FloatValue-members.html index 856124e..7fab487 100644 --- a/docs/classHazelnp_1_1FloatValue-members.html +++ b/docs/classHazelnp_1_1FloatValue-members.html @@ -101,7 +101,7 @@ $(function() { diff --git a/docs/classHazelnp_1_1FloatValue.html b/docs/classHazelnp_1_1FloatValue.html index 00c5a28..51ab16b 100644 --- a/docs/classHazelnp_1_1FloatValue.html +++ b/docs/classHazelnp_1_1FloatValue.html @@ -574,7 +574,7 @@ Additional Inherited Members
Hazelnp::HazelnuppValueNotConvertibleException
Gets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not ...
Definition: HazelnuppException.h:38
diff --git a/docs/classHazelnp_1_1HazelnuppConstraintException-members.html b/docs/classHazelnp_1_1HazelnuppConstraintException-members.html index 0a59cb1..0abd054 100644 --- a/docs/classHazelnp_1_1HazelnuppConstraintException-members.html +++ b/docs/classHazelnp_1_1HazelnuppConstraintException-members.html @@ -90,7 +90,7 @@ $(function() { diff --git a/docs/classHazelnp_1_1HazelnuppConstraintException.html b/docs/classHazelnp_1_1HazelnuppConstraintException.html index 347fac4..8655c35 100644 --- a/docs/classHazelnp_1_1HazelnuppConstraintException.html +++ b/docs/classHazelnp_1_1HazelnuppConstraintException.html @@ -201,7 +201,7 @@ Additional Inherited Members
Hazelnp::HazelnuppException::HazelnuppException
HazelnuppException()
Definition: HazelnuppException.h:14
diff --git a/docs/classHazelnp_1_1HazelnuppConstraintMissingValue-members.html b/docs/classHazelnp_1_1HazelnuppConstraintMissingValue-members.html index 2799c34..ab472b6 100644 --- a/docs/classHazelnp_1_1HazelnuppConstraintMissingValue-members.html +++ b/docs/classHazelnp_1_1HazelnuppConstraintMissingValue-members.html @@ -92,7 +92,7 @@ $(function() { diff --git a/docs/classHazelnp_1_1HazelnuppConstraintMissingValue.html b/docs/classHazelnp_1_1HazelnuppConstraintMissingValue.html index 6c03d68..4215a19 100644 --- a/docs/classHazelnp_1_1HazelnuppConstraintMissingValue.html +++ b/docs/classHazelnp_1_1HazelnuppConstraintMissingValue.html @@ -228,7 +228,7 @@ Additional Inherited Members
Hazelnp::HazelnuppException::message
std::string message
Definition: HazelnuppException.h:24
diff --git a/docs/classHazelnp_1_1HazelnuppConstraintTypeMissmatch-members.html b/docs/classHazelnp_1_1HazelnuppConstraintTypeMissmatch-members.html index f6bcf9b..5a149a8 100644 --- a/docs/classHazelnp_1_1HazelnuppConstraintTypeMissmatch-members.html +++ b/docs/classHazelnp_1_1HazelnuppConstraintTypeMissmatch-members.html @@ -93,7 +93,7 @@ $(function() { diff --git a/docs/classHazelnp_1_1HazelnuppConstraintTypeMissmatch.html b/docs/classHazelnp_1_1HazelnuppConstraintTypeMissmatch.html index 85589d2..c341c46 100644 --- a/docs/classHazelnp_1_1HazelnuppConstraintTypeMissmatch.html +++ b/docs/classHazelnp_1_1HazelnuppConstraintTypeMissmatch.html @@ -273,7 +273,7 @@ Additional Inherited Members
Hazelnp::DataTypeToString
static std::string DataTypeToString(DATA_TYPE type)
Definition: DataType.h:17
diff --git a/docs/classHazelnp_1_1HazelnuppException-members.html b/docs/classHazelnp_1_1HazelnuppException-members.html index 7f9af74..ea6c835 100644 --- a/docs/classHazelnp_1_1HazelnuppException-members.html +++ b/docs/classHazelnp_1_1HazelnuppException-members.html @@ -88,7 +88,7 @@ $(function() { diff --git a/docs/classHazelnp_1_1HazelnuppException.html b/docs/classHazelnp_1_1HazelnuppException.html index 4ff61df..252229b 100644 --- a/docs/classHazelnp_1_1HazelnuppException.html +++ b/docs/classHazelnp_1_1HazelnuppException.html @@ -255,7 +255,7 @@ Protected Attributes
Hazelnp::HazelnuppException::message
std::string message
Definition: HazelnuppException.h:24
diff --git a/docs/classHazelnp_1_1HazelnuppInvalidKeyException-members.html b/docs/classHazelnp_1_1HazelnuppInvalidKeyException-members.html index fd9edfd..26e24e3 100644 --- a/docs/classHazelnp_1_1HazelnuppInvalidKeyException-members.html +++ b/docs/classHazelnp_1_1HazelnuppInvalidKeyException-members.html @@ -90,7 +90,7 @@ $(function() { diff --git a/docs/classHazelnp_1_1HazelnuppInvalidKeyException.html b/docs/classHazelnp_1_1HazelnuppInvalidKeyException.html index 0538ffc..ac0f4a5 100644 --- a/docs/classHazelnp_1_1HazelnuppInvalidKeyException.html +++ b/docs/classHazelnp_1_1HazelnuppInvalidKeyException.html @@ -199,7 +199,7 @@ Additional Inherited Members
Hazelnp::HazelnuppException::HazelnuppException
HazelnuppException()
Definition: HazelnuppException.h:14
diff --git a/docs/classHazelnp_1_1HazelnuppValueNotConvertibleException-members.html b/docs/classHazelnp_1_1HazelnuppValueNotConvertibleException-members.html index 8aad1d8..7604f41 100644 --- a/docs/classHazelnp_1_1HazelnuppValueNotConvertibleException-members.html +++ b/docs/classHazelnp_1_1HazelnuppValueNotConvertibleException-members.html @@ -90,7 +90,7 @@ $(function() { diff --git a/docs/classHazelnp_1_1HazelnuppValueNotConvertibleException.html b/docs/classHazelnp_1_1HazelnuppValueNotConvertibleException.html index d73f0e3..4bf567a 100644 --- a/docs/classHazelnp_1_1HazelnuppValueNotConvertibleException.html +++ b/docs/classHazelnp_1_1HazelnuppValueNotConvertibleException.html @@ -199,7 +199,7 @@ Additional Inherited Members
Hazelnp::HazelnuppException::HazelnuppException
HazelnuppException()
Definition: HazelnuppException.h:14
diff --git a/docs/classHazelnp_1_1IntValue-members.html b/docs/classHazelnp_1_1IntValue-members.html index c9c93d3..644cfcc 100644 --- a/docs/classHazelnp_1_1IntValue-members.html +++ b/docs/classHazelnp_1_1IntValue-members.html @@ -101,7 +101,7 @@ $(function() { diff --git a/docs/classHazelnp_1_1IntValue.html b/docs/classHazelnp_1_1IntValue.html index c577caf..c2c9c9b 100644 --- a/docs/classHazelnp_1_1IntValue.html +++ b/docs/classHazelnp_1_1IntValue.html @@ -574,7 +574,7 @@ Additional Inherited Members
Hazelnp::HazelnuppValueNotConvertibleException
Gets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not ...
Definition: HazelnuppException.h:38
diff --git a/docs/classHazelnp_1_1Internal_1_1StringTools-members.html b/docs/classHazelnp_1_1Internal_1_1StringTools-members.html new file mode 100644 index 0000000..72cf076 --- /dev/null +++ b/docs/classHazelnp_1_1Internal_1_1StringTools-members.html @@ -0,0 +1,100 @@ + + + + + + + +Leonetienne/Hazelnupp: Member List + + + + + + + + + + + +
+
+ + + + + + + +
+
Leonetienne/Hazelnupp +
+
Simple, easy to use, command line parameter interface
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
Hazelnp::Internal::StringTools Member List
+
+
+ +

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::StringToolsstatic
IsNumeric(const std::string &str, const bool allowDecimalPoint=false)Hazelnp::Internal::StringToolsstatic
ParseNumber(const std::string &str, bool &out_isInt, long double &out_number)Hazelnp::Internal::StringToolsstatic
Replace(const std::string &str, const char find, const std::string &subst)Hazelnp::Internal::StringToolsstatic
Replace(const std::string &str, const std::string &find, const std::string &subst)Hazelnp::Internal::StringToolsstatic
SplitString(const std::string &str, const char delimiter)Hazelnp::Internal::StringToolsstatic
SplitString(const std::string &str, const std::string &delimiter)Hazelnp::Internal::StringToolsstatic
ToLower(const std::string &str)Hazelnp::Internal::StringToolsstatic
+ + + + diff --git a/docs/classHazelnp_1_1Internal_1_1StringTools.html b/docs/classHazelnp_1_1Internal_1_1StringTools.html new file mode 100644 index 0000000..b5625a0 --- /dev/null +++ b/docs/classHazelnp_1_1Internal_1_1StringTools.html @@ -0,0 +1,634 @@ + + + + + + + +Leonetienne/Hazelnupp: Hazelnp::Internal::StringTools Class Reference + + + + + + + + + + + +
+
+ + + + + + + +
+
Leonetienne/Hazelnupp +
+
Simple, easy to use, command line parameter interface
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+Static Public Member Functions | +List of all members
+
+
Hazelnp::Internal::StringTools Class Reference
+
+
+ +

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...
 
+

Detailed Description

+

Internal helper class.

+

Feel free to use it tho.

+ +

Definition at line 13 of file StringTools.h.

+

Member Function Documentation

+ +

◆ Contains()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool Internal::StringTools::Contains (const std::string & str,
const char c 
)
+
+static
+
+ +

Will return wether or not a given char is in a string.

+ +

Definition at line 5 of file StringTools.cpp.

+
6 {
+
7  for (const char& i : str)
+
8  if (i == c)
+
9  return true;
+
10 
+
11  return false;
+
12 }
+
+
+
+ +

◆ IsNumeric()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool Internal::StringTools::IsNumeric (const std::string & str,
const bool allowDecimalPoint = false 
)
+
+static
+
+ +

Will return true if the given string consists only of digits (including signage)

+ +

Definition at line 56 of file StringTools.cpp.

+
57 {
+
58  if (str.length() == 0) return false;
+
59 
+
60  bool alreadyParsedDecimalPoint = false;
+
61  std::size_t digitCount = 0;
+
62 
+
63  for (std::size_t i = 0; i < str.length(); i++)
+
64  {
+
65  if (!(
+
66  ((str[i] >= '0') && (str[i] <= '9')) ||
+
67  ((str[i] == '-') && (i == 0)) ||
+
68  ((str[i] == '.') && (allowDecimalPoint) && (!alreadyParsedDecimalPoint) && (digitCount > 0))
+
69  )) return false;
+
70 
+
71 
+
72  // Here we just have to check for the character. Not for any other conditions.
+
73  // Why? Because if these conditions failed, the function would have already returned false.
+
74  if (((str[i] >= '0') && (str[i] <= '9'))) digitCount++;
+
75  if (str[i] == '.') alreadyParsedDecimalPoint = true;
+
76  }
+
77 
+
78  // Even if we did not find any invalid chars, we should still return false, if we found no digits at all.
+
79  return digitCount > 0;
+
80 }
+
+
+
+ +

◆ ParseNumber()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool Internal::StringTools::ParseNumber (const std::string & str,
bool & out_isInt,
long double & out_number 
)
+
+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.

+
83 {
+
84  bool isDecimal = false;
+
85 
+
86  if (str.length() == 0) return false;
+
87  if (Contains(str, '.')) isDecimal = true;
+
88 
+
89  if (isDecimal)
+
90  {
+
91  try
+
92  {
+
93  out_number = std::stold(str);
+
94  out_isInt = false;
+
95  }
+
96  catch (std::invalid_argument&)
+
97  {
+
98  return false;
+
99  }
+
100  catch (std::out_of_range&)
+
101  {
+
102  return false;
+
103  }
+
104  }
+
105  else
+
106  {
+
107  try
+
108  {
+
109  out_number = (long double)std::stoll(str);
+
110  out_isInt = true;
+
111  }
+
112  catch (std::invalid_argument&)
+
113  {
+
114  return false;
+
115  }
+
116  catch (std::out_of_range&)
+
117  {
+
118  return false;
+
119  }
+
120  }
+
121 
+
122  return true;
+
123 }
+
+
+
+ +

◆ Replace() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
std::string Internal::StringTools::Replace (const std::string & str,
const char find,
const std::string & subst 
)
+
+static
+
+ +

Will replace a part of a string with another string.

+ +

Definition at line 14 of file StringTools.cpp.

+
15 {
+
16  std::stringstream ss;
+
17 
+
18  for (std::size_t i = 0; i < str.length(); i++)
+
19  {
+
20  if (str[i] != find) ss << str[i];
+
21  else ss << subst;
+
22  }
+
23 
+
24  return ss.str();
+
25 }
+
+
+
+ +

◆ Replace() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
std::string Internal::StringTools::Replace (const std::string & str,
const std::string & find,
const std::string & subst 
)
+
+static
+
+ +

Will replace a part of a string with another string.

+ +

Definition at line 27 of file StringTools.cpp.

+
28 {
+
29  if (find.length() == 0) return str;
+
30 
+
31  std::stringstream ss;
+
32 
+
33  std::size_t posFound = 0;
+
34  std::size_t lastFound = 0;
+
35 
+
36  while (posFound != std::string::npos)
+
37  {
+
38  lastFound = posFound;
+
39  posFound = str.find(find, posFound);
+
40 
+
41  if (posFound != std::string::npos)
+
42  {
+
43  ss << str.substr(lastFound, posFound - lastFound) << subst;
+
44  posFound += find.length();
+
45  }
+
46  else
+
47  {
+
48  ss << str.substr(lastFound, (str.length()) - lastFound);
+
49  }
+
50  }
+
51 
+
52  return ss.str();
+
53 }
+
+
+
+ +

◆ SplitString() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
std::vector< std::string > Internal::StringTools::SplitString (const std::string & str,
const char delimiter 
)
+
+static
+
+ +

Will split a string by a delimiter char. The delimiter will be excluded!

+ +

Definition at line 125 of file StringTools.cpp.

+
126 {
+
127  if (str.length() == 0) return std::vector<std::string>();
+
128 
+
129  return SplitString(str, delimiter);
+
130 }
+
+
+
+ +

◆ SplitString() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
std::vector< std::string > Internal::StringTools::SplitString (const std::string & str,
const std::string & delimiter 
)
+
+static
+
+ +

Will split a string by a delimiter string. The delimiter will be excluded!

+ +

Definition at line 132 of file StringTools.cpp.

+
133 {
+
134  if (str.length() == 0) return std::vector<std::string>();
+
135 
+
136  std::vector<std::string> parts;
+
137 
+
138  if (delimiter.length() == 0) // If the delimiter is "" (empty), just split between every single char. Not useful, but logical
+
139  {
+
140  for (std::size_t i = 0; i < str.length(); i++)
+
141  {
+
142  parts.push_back(std::string({ str[i] }));
+
143  }
+
144  return parts;
+
145  }
+
146 
+
147  std::size_t posFound = 0;
+
148  std::size_t lastFound = 0;
+
149 
+
150  while (posFound != std::string::npos)
+
151  {
+
152  lastFound = posFound;
+
153  posFound = str.find(delimiter, posFound);
+
154 
+
155  std::string found;
+
156 
+
157  if (posFound != std::string::npos)
+
158  {
+
159  found = str.substr(lastFound, posFound - lastFound);
+
160  posFound += delimiter.length();
+
161  }
+
162  else
+
163  {
+
164  found = str.substr(lastFound, str.length() - lastFound);
+
165  }
+
166 
+
167  parts.push_back(found);
+
168  }
+
169 
+
170  return parts;
+
171 }
+
+
+
+ +

◆ ToLower()

+ +
+
+ + + + + +
+ + + + + + + + +
std::string Internal::StringTools::ToLower (const std::string & str)
+
+static
+
+ +

Will make a string all lower-case.

+ +

Definition at line 173 of file StringTools.cpp.

+
174 {
+
175  std::stringstream ss;
+
176  for (std::size_t i = 0; i < str.length(); i++)
+
177  {
+
178  if ((str[i] >= 'A') && (str[i] <= 'Z')) ss << (char)(((int)str[i]) + 32);
+
179  else if (str[i] == -60) ss << (char)-28; // AE => ae
+
180  else if (str[i] == -42) ss << (char)-10; // OE => oe
+
181  else if (str[i] == -36) ss << (char)-4; // UE => ue
+
182  else ss << str[i];
+
183  }
+
184 
+
185  return ss.str();
+
186 }
+
+
+
+
The documentation for this class was generated from the following files: +
+
Hazelnp::Internal::StringTools::Contains
static bool Contains(const std::string &str, const char c)
Will return wether or not a given char is in a string.
Definition: StringTools.cpp:5
+
Hazelnp::Internal::StringTools::SplitString
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!
Definition: StringTools.cpp:125
+ + + + diff --git a/docs/classHazelnp_1_1ListValue-members.html b/docs/classHazelnp_1_1ListValue-members.html index 2a37427..32ce408 100644 --- a/docs/classHazelnp_1_1ListValue-members.html +++ b/docs/classHazelnp_1_1ListValue-members.html @@ -101,7 +101,7 @@ $(function() { diff --git a/docs/classHazelnp_1_1ListValue.html b/docs/classHazelnp_1_1ListValue.html index 2202ad2..8e458f7 100644 --- a/docs/classHazelnp_1_1ListValue.html +++ b/docs/classHazelnp_1_1ListValue.html @@ -601,7 +601,7 @@ Additional Inherited Members
Hazelnp::HazelnuppValueNotConvertibleException
Gets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not ...
Definition: HazelnuppException.h:38
diff --git a/docs/classHazelnp_1_1Parameter-members.html b/docs/classHazelnp_1_1Parameter-members.html index 1acab54..e79893b 100644 --- a/docs/classHazelnp_1_1Parameter-members.html +++ b/docs/classHazelnp_1_1Parameter-members.html @@ -89,7 +89,7 @@ $(function() { diff --git a/docs/classHazelnp_1_1Parameter.html b/docs/classHazelnp_1_1Parameter.html index fe162f3..ca33a33 100644 --- a/docs/classHazelnp_1_1Parameter.html +++ b/docs/classHazelnp_1_1Parameter.html @@ -275,7 +275,7 @@ Friends
Hazelnp::Value::Deepcopy
virtual Value * Deepcopy() const =0
Will return a deeopopy of this object.
diff --git a/docs/classHazelnp_1_1StringValue-members.html b/docs/classHazelnp_1_1StringValue-members.html index 2dff981..f6b3d06 100644 --- a/docs/classHazelnp_1_1StringValue-members.html +++ b/docs/classHazelnp_1_1StringValue-members.html @@ -100,7 +100,7 @@ $(function() { diff --git a/docs/classHazelnp_1_1StringValue.html b/docs/classHazelnp_1_1StringValue.html index 73f564a..f7dc7ef 100644 --- a/docs/classHazelnp_1_1StringValue.html +++ b/docs/classHazelnp_1_1StringValue.html @@ -547,7 +547,7 @@ Additional Inherited Members
Hazelnp::HazelnuppValueNotConvertibleException
Gets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not ...
Definition: HazelnuppException.h:38
diff --git a/docs/classHazelnp_1_1Value-members.html b/docs/classHazelnp_1_1Value-members.html index 2b6a42c..e43eddc 100644 --- a/docs/classHazelnp_1_1Value-members.html +++ b/docs/classHazelnp_1_1Value-members.html @@ -97,7 +97,7 @@ $(function() { diff --git a/docs/classHazelnp_1_1Value.html b/docs/classHazelnp_1_1Value.html index 5200b04..d559254 100644 --- a/docs/classHazelnp_1_1Value.html +++ b/docs/classHazelnp_1_1Value.html @@ -548,7 +548,7 @@ Friends
Hazelnp::Value::type
DATA_TYPE type
Definition: Value.h:48
diff --git a/docs/classHazelnp_1_1VoidValue-members.html b/docs/classHazelnp_1_1VoidValue-members.html index d6b7761..949dec6 100644 --- a/docs/classHazelnp_1_1VoidValue-members.html +++ b/docs/classHazelnp_1_1VoidValue-members.html @@ -98,7 +98,7 @@ $(function() { diff --git a/docs/classHazelnp_1_1VoidValue.html b/docs/classHazelnp_1_1VoidValue.html index c3bfa60..36e1b24 100644 --- a/docs/classHazelnp_1_1VoidValue.html +++ b/docs/classHazelnp_1_1VoidValue.html @@ -494,7 +494,7 @@ Additional Inherited Members
Hazelnp::HazelnuppValueNotConvertibleException
Gets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not ...
Definition: HazelnuppException.h:38
diff --git a/docs/classes.html b/docs/classes.html index 5bc2324..ef13a7e 100644 --- a/docs/classes.html +++ b/docs/classes.html @@ -90,7 +90,7 @@ $(function() { CmdArgsInterface (Hazelnp)    HazelnuppException (Hazelnp)    ListValue (Hazelnp)    -StringTools (Hazelnp)    +StringTools (Hazelnp::Internal)   
  f  
@@ -123,7 +123,7 @@ $(function() { diff --git a/docs/dir_0202e1e26df2e040f4dc3d434eecf04c.html b/docs/dir_0202e1e26df2e040f4dc3d434eecf04c.html index cd4b60e..808ddfd 100644 --- a/docs/dir_0202e1e26df2e040f4dc3d434eecf04c.html +++ b/docs/dir_0202e1e26df2e040f4dc3d434eecf04c.html @@ -136,7 +136,7 @@ Files diff --git a/docs/dir_0cc5f59b28c403d42cc56800132eb975.html b/docs/dir_0cc5f59b28c403d42cc56800132eb975.html index b698296..86fb80f 100644 --- a/docs/dir_0cc5f59b28c403d42cc56800132eb975.html +++ b/docs/dir_0cc5f59b28c403d42cc56800132eb975.html @@ -81,7 +81,7 @@ $(function() { diff --git a/docs/dir_1148ebc2b25b55095aebf6f4cbb6efca.html b/docs/dir_1148ebc2b25b55095aebf6f4cbb6efca.html index 87743ab..67654db 100644 --- a/docs/dir_1148ebc2b25b55095aebf6f4cbb6efca.html +++ b/docs/dir_1148ebc2b25b55095aebf6f4cbb6efca.html @@ -81,7 +81,7 @@ $(function() { diff --git a/docs/dir_a8cffda729361e9d9637effa362fcea9.html b/docs/dir_a8cffda729361e9d9637effa362fcea9.html index c2330a7..29262fd 100644 --- a/docs/dir_a8cffda729361e9d9637effa362fcea9.html +++ b/docs/dir_a8cffda729361e9d9637effa362fcea9.html @@ -81,7 +81,7 @@ $(function() { diff --git a/docs/files.html b/docs/files.html index d2b622c..94bdee7 100644 --- a/docs/files.html +++ b/docs/files.html @@ -107,7 +107,7 @@ $(function() { diff --git a/docs/functions.html b/docs/functions.html index ab24978..f19873b 100644 --- a/docs/functions.html +++ b/docs/functions.html @@ -106,7 +106,7 @@ $(function() { : Hazelnp::ParamConstraint
  • Contains() -: Hazelnp::StringTools +: Hazelnp::Internal::StringTools
  • @@ -263,7 +263,7 @@ $(function() { : Hazelnp::IntValue
  • IsNumeric() -: Hazelnp::StringTools +: Hazelnp::Internal::StringTools
  • @@ -329,7 +329,7 @@ $(function() { : Hazelnp::CmdArgsInterface
  • ParseNumber() -: Hazelnp::StringTools +: Hazelnp::Internal::StringTools
  • @@ -345,7 +345,7 @@ $(function() { : Hazelnp::CmdArgsInterface
  • Replace() -: Hazelnp::StringTools +: Hazelnp::Internal::StringTools
  • Require() : Hazelnp::ParamConstraint @@ -370,7 +370,7 @@ $(function() { : Hazelnp::CmdArgsInterface
  • SplitString() -: Hazelnp::StringTools +: Hazelnp::Internal::StringTools
  • StringValue() : Hazelnp::StringValue @@ -380,7 +380,7 @@ $(function() {

    - t -

    @@ -256,7 +256,7 @@ $(function() { : Hazelnp::IntValue
  • IsNumeric() -: Hazelnp::StringTools +: Hazelnp::Internal::StringTools
  • @@ -311,7 +311,7 @@ $(function() { : Hazelnp::CmdArgsInterface
  • ParseNumber() -: Hazelnp::StringTools +: Hazelnp::Internal::StringTools
  • @@ -327,7 +327,7 @@ $(function() { : Hazelnp::CmdArgsInterface
  • Replace() -: Hazelnp::StringTools +: Hazelnp::Internal::StringTools
  • Require() : Hazelnp::ParamConstraint @@ -346,7 +346,7 @@ $(function() { : Hazelnp::CmdArgsInterface
  • SplitString() -: Hazelnp::StringTools +: Hazelnp::Internal::StringTools
  • StringValue() : Hazelnp::StringValue @@ -356,7 +356,7 @@ $(function() {

    - t -