| Leonetienne/Hazelnupp Simple, easy to use, command line parameter interface

Public Member Functions | List of all members
Hazelnp::StringValue Class Reference

Specializations for string values (uses std::string) More...

`#include <StringValue.h>`

Inheritance diagram for Hazelnp::StringValue:
[legend]
Collaboration diagram for Hazelnp::StringValue:
[legend]

## Public Member Functions
| StringValue (const std::string &value)
| ~StringValue () override
Value * | Deepcopy () const override
| Will return a deeopopy of this object. More...
std::string | GetAsOsString () const override
| Will return a string suitable for an std::ostream;. More...
const std::string & | GetValue () const
| Will return the raw value. More...
| operator std::string () const
long long int | GetInt64 () const override
| Throws HazelnuppValueNotConvertibleException. More...
int | GetInt32 () const override
| Throws HazelnuppValueNotConvertibleException. More...
long double | GetFloat64 () const override
| Throws HazelnuppValueNotConvertibleException. More...
double | GetFloat32 () const override
| Throws HazelnuppValueNotConvertibleException. More...
std::string | GetString () const override
| Will return this value as a string. More...
const std::vector< Value * > & | GetList () const override
| Throws HazelnuppValueNotConvertibleException. More...
Public Member Functions inherited from Hazelnp::Value
virtual | ~Value ()
DATA_TYPE | GetDataType () const
| Will return the data type of this value. More...

## Additional Inherited Members
Protected Member Functions inherited from Hazelnp::Value
| Value (DATA_TYPE type)
Protected Attributes inherited from Hazelnp::Value
DATA_TYPE | type

## Detailed Description

Specializations for string values (uses std::string)

Definition at line 9 of file StringValue.h.

## Constructor & Destructor Documentation

## ◆ StringValue()

StringValue::StringValue | ( | const std::string & | value | ) |

Definition at line 7 of file StringValue.cpp.

8 :
9 Value(DATA_TYPE::STRING),
10 value { value }
11 {
12 return;
13 }

## ◆ ~StringValue()

Hazelnp::StringValue::~StringValue | ( |  | ) |
| inline override

Definition at line 13 of file StringValue.h.

13 {};

## Member Function Documentation

## ◆ Deepcopy()

Value * StringValue::Deepcopy | ( |  | ) | const
| override virtual

Will return a deeopopy of this object.

Implements Hazelnp::Value.

Definition at line 15 of file StringValue.cpp.

16 {
17 return new StringValue(value);
18 }

## ◆ GetAsOsString()

std::string StringValue::GetAsOsString | ( |  | ) | const
| override virtual

Will return a string suitable for an std::ostream;.

Implements Hazelnp::Value.

Definition at line 20 of file StringValue.cpp.

21 {
22 std::stringstream ss;
23 ss << "StringValue: " << value;
24 return ss.str();
25 }

## ◆ GetFloat32()

double StringValue::GetFloat32 | ( |  | ) | const
| override virtual

Throws HazelnuppValueNotConvertibleException.

Implements Hazelnp::Value.

Definition at line 54 of file StringValue.cpp.

55 {
56 throw HazelnuppValueNotConvertibleException();
57 }

## ◆ GetFloat64()

long double StringValue::GetFloat64 | ( |  | ) | const
| override virtual

Throws HazelnuppValueNotConvertibleException.

Implements Hazelnp::Value.

Definition at line 49 of file StringValue.cpp.

50 {
51 throw HazelnuppValueNotConvertibleException();
52 }

## ◆ GetInt32()

int StringValue::GetInt32 | ( |  | ) | const
| override virtual

Throws HazelnuppValueNotConvertibleException.

Implements Hazelnp::Value.

Definition at line 44 of file StringValue.cpp.

45 {
46 throw HazelnuppValueNotConvertibleException();
47 }

## ◆ GetInt64()

long long int StringValue::GetInt64 | ( |  | ) | const
| override virtual

Throws HazelnuppValueNotConvertibleException.

Implements Hazelnp::Value.

Definition at line 39 of file StringValue.cpp.

40 {
41 throw HazelnuppValueNotConvertibleException();
42 }

## ◆ GetList()

const std::vector< Value * > & StringValue::GetList | ( |  | ) | const
| override virtual

Throws HazelnuppValueNotConvertibleException.

Implements Hazelnp::Value.

Definition at line 64 of file StringValue.cpp.

65 {
66 throw HazelnuppValueNotConvertibleException();
67 }

## ◆ GetString()

std::string StringValue::GetString | ( |  | ) | const
| override virtual

Will return this value as a string.

Implements Hazelnp::Value.

Definition at line 59 of file StringValue.cpp.

60 {
61 return value;
62 }

## ◆ GetValue()

const std::string & StringValue::GetValue | ( |  | ) | const

Will return the raw value.

Definition at line 27 of file StringValue.cpp.

28 {
29 return value;
30 }

## ◆ operator std::string()

StringValue::operator std::string | ( |  | ) | const

Definition at line 32 of file StringValue.cpp.

33 {
34 return value;
35 }

The documentation for this class was generated from the following files:

- Hazelnupp/StringValue.h
- Hazelnupp/StringValue.cpp

Hazelnp::StringValue::StringValue
StringValue(const std::string &value)
Definition: StringValue.cpp:7
Hazelnp::Value::Value
Value(DATA_TYPE type)
Definition: Value.cpp:5
Hazelnp::DATA_TYPE::STRING
@ STRING
Hazelnp::HazelnuppValueNotConvertibleException
Gets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not ...
Definition: HazelnuppException.h:38