StringValue.h
Go to the documentation of this file.
#pragma once
#include "Value.h"
#include <string>
namespace Hazelnp
{
class StringValue : public Value
{
public:
StringValue(const std::string& value);
~StringValue() override {};
Value* Deepcopy() const override;
std::string GetAsOsString() const override;
const std::string& GetValue() const;
operator std::string() const;
long long int GetInt64() const override;
int GetInt32() const override;
long double GetFloat64() const override;
double GetFloat32() const override;
std::string GetString() const override;
const std::vector<Value*>& GetList() const override;
private:
std::string value;
};
}
Hazelnp
Definition: DataType.h:3
Hazelnp::StringValue::GetInt32
int GetInt32() const override
Throws HazelnuppValueNotConvertibleException.
Definition: StringValue.cpp:44
Hazelnp::StringValue::GetAsOsString
std::string GetAsOsString() const override
Will return a string suitable for an std::ostream;.
Definition: StringValue.cpp:20
Hazelnp::StringValue::StringValue
StringValue(const std::string &value)
Definition: StringValue.cpp:7
Hazelnp::Value
Abstract class for values.
Definition: Value.h:10
Hazelnp::StringValue::~StringValue
~StringValue() override
Definition: StringValue.h:13
Hazelnp::StringValue::GetInt64
long long int GetInt64() const override
Throws HazelnuppValueNotConvertibleException.
Definition: StringValue.cpp:39
Hazelnp::StringValue::GetString
std::string GetString() const override
Will return this value as a string.
Definition: StringValue.cpp:59
Hazelnp::StringValue::GetFloat32
double GetFloat32() const override
Throws HazelnuppValueNotConvertibleException.
Definition: StringValue.cpp:54
Hazelnp::StringValue::Deepcopy
Value * Deepcopy() const override
Will return a deeopopy of this object.
Definition: StringValue.cpp:15
Hazelnp::StringValue::GetFloat64
long double GetFloat64() const override
Throws HazelnuppValueNotConvertibleException.
Definition: StringValue.cpp:49
Hazelnp::StringValue::GetList
const std::vector< Value * > & GetList() const override
Throws HazelnuppValueNotConvertibleException.
Definition: StringValue.cpp:64
Hazelnp::StringValue
Specializations for string values (uses std::string)
Definition: StringValue.h:9
Hazelnp::StringValue::GetValue
const std::string & GetValue() const
Will return the raw value.
Definition: StringValue.cpp:27
Value.h