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.

:
Value(DATA_TYPE::STRING),
value { value }
{
return;
}

## ~StringValue()

Hazelnp::StringValue::~StringValue | ( |  | ) |

inlineoverride

Definition at line 13 of file StringValue.h.

{};

## Member Function Documentation

## Deepcopy()

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

overridevirtual

Will return a deeopopy of this object.

Implements Hazelnp::Value.

Definition at line 15 of file StringValue.cpp.

{
return new StringValue(value);
}

## GetAsOsString()

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

overridevirtual

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

Implements Hazelnp::Value.

Definition at line 20 of file StringValue.cpp.

{
std::stringstream ss;
ss << "StringValue: " << value;
return ss.str();
}

## GetFloat32()

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

overridevirtual

Throws HazelnuppValueNotConvertibleException.

Implements Hazelnp::Value.

Definition at line 54 of file StringValue.cpp.

{
throw HazelnuppValueNotConvertibleException();
}

## GetFloat64()

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

overridevirtual

Throws HazelnuppValueNotConvertibleException.

Implements Hazelnp::Value.

Definition at line 49 of file StringValue.cpp.

{
throw HazelnuppValueNotConvertibleException();
}

## GetInt32()

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

overridevirtual

Throws HazelnuppValueNotConvertibleException.

Implements Hazelnp::Value.

Definition at line 44 of file StringValue.cpp.

{
throw HazelnuppValueNotConvertibleException();
}

## GetInt64()

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

overridevirtual

Throws HazelnuppValueNotConvertibleException.

Implements Hazelnp::Value.

Definition at line 39 of file StringValue.cpp.

{
throw HazelnuppValueNotConvertibleException();
}

## GetList()

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

overridevirtual

Throws HazelnuppValueNotConvertibleException.

Implements Hazelnp::Value.

Definition at line 64 of file StringValue.cpp.

{
throw HazelnuppValueNotConvertibleException();
}

## GetString()

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

overridevirtual

Will return this value as a string.

Implements Hazelnp::Value.

Definition at line 59 of file StringValue.cpp.

{
return value;
}

## GetValue()

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

Will return the raw value.

Definition at line 27 of file StringValue.cpp.

{
return value;
}

## operator std::string()

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

Definition at line 32 of file StringValue.cpp.

{
return value;
}

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:35