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