A helper class for escaping strings using C-style escapes. More...
#include <EscapedString.h>
Public Member Functions | |
EscapedString (const string &str) | |
Constructs an EscapedString helper. More... | |
string | Generate () const |
Generates an escaped string, from the original string. More... | |
string | Decode (bool &success) const |
Decodes an escaped string, from the original string. More... | |
Static Public Member Functions | |
static void | RunUnitTests (int &nSucceeded, int &nFailures) |
![]() | |
static void | RunUnitTests (int &nSucceeded, int &nFailures) |
Runs unit test cases. More... | |
A helper class for escaping strings using C-style escapes.
TODO: It is ugly to use this for conversions in both directions! Should be fixed some day.
Definition at line 42 of file EscapedString.h.
EscapedString::EscapedString | ( | const string & | str | ) |
Constructs an EscapedString helper.
str | A string, either escaped or not escaped. |
Definition at line 31 of file EscapedString.cc.
string EscapedString::Decode | ( | bool & | success | ) | const |
Decodes an escaped string, from the original string.
The original string should be a C-style escaped string, with or without surrounding quote (") characters.
success | Set to true if decoding was successful, false if there was an error. |
success
was set to true.) Definition at line 71 of file EscapedString.cc.
Referenced by StateVariable::SetValue().
string EscapedString::Generate | ( | ) | const |
Generates an escaped string, from the original string.
Definition at line 37 of file EscapedString.cc.
Referenced by Component::AddChild(), and StateVariable::SerializeValue().
|
static |