Leonetienne/Hazelnupp
Simple, easy to use, command line parameter interface
ListValue.h
Go to the documentation of this file.
1#pragma once
2#include "Value.h"
3#include <vector>
4
5namespace Hazelnp
6{
7 /** Specializations for list values (uses std::vector<Value*>)
8 */
9 class ListValue : public Value
10 {
11 public:
12 ListValue();
13 ~ListValue() override;
14
15 //! Will return a deeopopy of this object
16 Value* Deepcopy() const override;
17
18 //! Will return a string suitable for an std::ostream;
19 std::string GetAsOsString() const override;
20
21 //! Will add this value to the list
22 void AddValue(const Value* value);
23
24 //! Will return the raw value
25 const std::vector<Value*>& GetValue() const;
26
27 operator std::vector<Value*>() const;
28
29 //! Throws HazelnuppValueNotConvertibleException
30 long long int GetInt64() const override;
31 //! Throws HazelnuppValueNotConvertibleException
32 int GetInt32() const override;
33
34 //! Throws HazelnuppValueNotConvertibleException
35 long double GetFloat64() const override;
36 //! Throws HazelnuppValueNotConvertibleException
37 double GetFloat32() const override;
38
39 //! Throws HazelnuppValueNotConvertibleException
40 std::string GetString() const override;
41
42 //! Will return this values list
43 const std::vector<Value*>& GetList() const override;
44
45 private:
46 std::vector<Value*> value;
47 };
48}
Specializations for list values (uses std::vector<Value*>)
Definition: ListValue.h:10
Value * Deepcopy() const override
Will return a deeopopy of this object.
Definition: ListValue.cpp:23
int GetInt32() const override
Throws HazelnuppValueNotConvertibleException.
Definition: ListValue.cpp:74
long double GetFloat64() const override
Throws HazelnuppValueNotConvertibleException.
Definition: ListValue.cpp:79
std::string GetAsOsString() const override
Will return a string suitable for an std::ostream;.
Definition: ListValue.cpp:44
double GetFloat32() const override
Throws HazelnuppValueNotConvertibleException.
Definition: ListValue.cpp:84
const std::vector< Value * > & GetValue() const
Will return the raw value.
Definition: ListValue.cpp:39
~ListValue() override
Definition: ListValue.cpp:13
long long int GetInt64() const override
Throws HazelnuppValueNotConvertibleException.
Definition: ListValue.cpp:69
const std::vector< Value * > & GetList() const override
Will return this values list.
Definition: ListValue.cpp:94
std::string GetString() const override
Throws HazelnuppValueNotConvertibleException.
Definition: ListValue.cpp:89
void AddValue(const Value *value)
Will add this value to the list.
Definition: ListValue.cpp:33
Abstract class for values.
Definition: Value.h:11