Leonetienne/Hazelnupp
Simple, easy to use, command line parameter interface
StringValue.cpp
Go to the documentation of this file.
3#include <sstream>
4
5using namespace Hazelnp;
6
7StringValue::StringValue(const std::string& value)
8 :
10 value { value }
11{
12 return;
13}
14
16{
17 return new StringValue(value);
18}
19
20std::string StringValue::GetAsOsString() const
21{
22 std::stringstream ss;
23 ss << "StringValue: " << value;
24 return ss.str();
25}
26
27const std::string& StringValue::GetValue() const
28{
29 return value;
30}
31
32StringValue::operator std::string() const
33{
34 return value;
35}
36
37
38
39long long int StringValue::GetInt64() const
40{
42}
43
45{
47}
48
49long double StringValue::GetFloat64() const
50{
52}
53
55{
57}
58
59std::string StringValue::GetString() const
60{
61 return value;
62}
63
64const std::vector<Value*>& StringValue::GetList() const
65{
67}
Gets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not ...
Value * Deepcopy() const override
Will return a deeopopy of this object.
Definition: StringValue.cpp:15
StringValue(const std::string &value)
Definition: StringValue.cpp:7
const std::vector< Value * > & GetList() const override
Throws HazelnuppValueNotConvertibleException.
Definition: StringValue.cpp:64
double GetFloat32() const override
Throws HazelnuppValueNotConvertibleException.
Definition: StringValue.cpp:54
const std::string & GetValue() const
Will return the raw value.
Definition: StringValue.cpp:27
std::string GetAsOsString() const override
Will return a string suitable for an std::ostream;.
Definition: StringValue.cpp:20
long double GetFloat64() const override
Throws HazelnuppValueNotConvertibleException.
Definition: StringValue.cpp:49
std::string GetString() const override
Will return this value as a string.
Definition: StringValue.cpp:59
long long int GetInt64() const override
Throws HazelnuppValueNotConvertibleException.
Definition: StringValue.cpp:39
int GetInt32() const override
Throws HazelnuppValueNotConvertibleException.
Definition: StringValue.cpp:44
Abstract class for values.
Definition: Value.h:11
DATA_TYPE
The different data types a paramater can be.
Definition: DataType.h:9