A helper class, with static functions for common string operations. More...
#include <StringHelper.h>
Static Public Member Functions | |
static uint64_t | ParseNumber (const char *str, bool &error) |
Parses a string into a 64-bit number. More... | |
static vector< string > | SplitStringIntoVector (const string &str, const char splitter) |
Splits a string with a certain delimiter into a vector of strings. More... | |
static void | RunUnitTests (int &nSucceeded, int &nFailures) |
![]() | |
static void | RunUnitTests (int &nSucceeded, int &nFailures) |
Runs unit test cases. More... | |
A helper class, with static functions for common string operations.
Definition at line 39 of file StringHelper.h.
|
static |
Parses a string into a 64-bit number.
str | A pointer to a character string. |
error | Set to false if a parsed value is returned, true on parse errors. |
Definition at line 34 of file StringHelper.cc.
Referenced by Component::CheckVariableWrite(), FileLoader_raw::LoadIntoComponent(), and StateVariable::SetValue().
|
static |
|
static |
Splits a string with a certain delimiter into a vector of strings.
E.g. if the input string is "A:B:C" and the splitter is ':', then the resulting vector consists of 3 strings: "A", "B", and "C".
NOTE: The current implementation is very slow, but it at least it works.
str | A string to split. |
splitter | Set to false if a parsed value is returned, true on parse errors. |
Definition at line 99 of file StringHelper.cc.
Referenced by ComponentFactory::CreateComponent(), FileLoader_raw::DetectFileType(), and FileLoader_raw::LoadIntoComponent().