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

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
Value Class Referenceabstract

Abstract class for values. More...

`#include <Value.h>`

Inheritance diagram for Value:
[legend]

## Public Member Functions
virtual | ~Value ()
virtual Value * | Deepcopy () const =0
| Will return a deeopopy of this object. More...
virtual std::string | GetAsOsString () const =0
| Will return a string suitable for an std::ostream. More...
DATA_TYPE | GetDataType () const
| Will return the data type of this value. More...
virtual long long int | GetInt64 () const =0
| Will attempt to return the integer data (long long) More...
virtual int | GetInt32 () const =0
| Will attempt to return the integer data (int) More...
virtual long double | GetFloat64 () const =0
| Will attempt to return the floating-point data (long double) More...
virtual double | GetFloat32 () const =0
| Will attempt to return the floating-point data (double) More...
virtual std::string | GetString () const =0
| Will attempt to return the string-data. More...
virtual const std::vector< Value * > & | GetList () const =0
| Will attempt to return the list-data. More...

## Protected Member Functions
| Value (DATA_TYPE type)

## Protected Attributes
DATA_TYPE | type

## Friends
std::ostream & | operator<< (std::ostream &os, const Value &v)

## Detailed Description

Abstract class for values.

Definition at line 8 of file Value.h.

## Constructor & Destructor Documentation

## ◆ ~Value()

virtual Value::~Value | ( |  | ) |
| inline virtual

Definition at line 11 of file Value.h.

11 {};

## ◆ Value()

Value::Value | ( | DATA_TYPE | type | ) |
| protected

Definition at line 3 of file Value.cpp.

4 :
5 type{ type }
6 {
7 return;
8 }

## Member Function Documentation

## ◆ Deepcopy()

virtual Value* Value::Deepcopy | ( |  | ) | const
| pure virtual

Will return a deeopopy of this object.

Implemented in FloatValue, ListValue, StringValue, IntValue, and VoidValue.

## ◆ GetAsOsString()

virtual std::string Value::GetAsOsString | ( |  | ) | const
| pure virtual

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

Implemented in FloatValue, ListValue, StringValue, IntValue, and VoidValue.

## ◆ GetDataType()

DATA_TYPE Value::GetDataType | ( |  | ) | const

Will return the data type of this value.

Definition at line 10 of file Value.cpp.

11 {
12 return type;
13 }

## ◆ GetFloat32()

virtual double Value::GetFloat32 | ( |  | ) | const
| pure virtual

Will attempt to return the floating-point data (double)

Implemented in ListValue, FloatValue, IntValue, StringValue, and VoidValue.

## ◆ GetFloat64()

virtual long double Value::GetFloat64 | ( |  | ) | const
| pure virtual

Will attempt to return the floating-point data (long double)

Implemented in ListValue, FloatValue, IntValue, StringValue, and VoidValue.

## ◆ GetInt32()

virtual int Value::GetInt32 | ( |  | ) | const
| pure virtual

Will attempt to return the integer data (int)

Implemented in ListValue, FloatValue, IntValue, StringValue, and VoidValue.

## ◆ GetInt64()

virtual long long int Value::GetInt64 | ( |  | ) | const
| pure virtual

Will attempt to return the integer data (long long)

Implemented in ListValue, FloatValue, IntValue, StringValue, and VoidValue.

## ◆ GetList()

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

Will attempt to return the list-data.

Implemented in ListValue, FloatValue, IntValue, StringValue, and VoidValue.

## ◆ GetString()

virtual std::string Value::GetString | ( |  | ) | const
| pure virtual

Will attempt to return the string-data.

Implemented in ListValue, FloatValue, IntValue, StringValue, and VoidValue.

## Friends And Related Function Documentation

## ◆ operator<<

std::ostream& operator<< | ( | std::ostream & | os,
|  | const Value & | v
| ) |  |
| friend

Definition at line 22 of file Value.h.

23 {
24 return os << v.GetAsOsString();
25 }

## Member Data Documentation

## ◆ type

DATA_TYPE Value::type
| protected

Definition at line 46 of file Value.h.

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

- Hazelnupp/Value.h
- Hazelnupp/Value.cpp

Value::type
DATA_TYPE type
Definition: Value.h:46
Value::GetAsOsString
virtual std::string GetAsOsString() const =0
Will return a string suitable for an std::ostream.