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