| 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
5 namespace 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 }
Hazelnp::ListValue::GetAsOsString
std::string GetAsOsString() const override
Will return a string suitable for an std::ostream;.
Definition: ListValue.cpp:44
Hazelnp
Definition: CmdArgsInterface.h:7
Hazelnp::ListValue::GetFloat32
double GetFloat32() const override
Throws HazelnuppValueNotConvertibleException.
Definition: ListValue.cpp:84
Hazelnp::ListValue::GetString
std::string GetString() const override
Throws HazelnuppValueNotConvertibleException.
Definition: ListValue.cpp:89
Hazelnp::ListValue::GetList
const std::vector< Value * > & GetList() const override
Will return this values list.
Definition: ListValue.cpp:94
Hazelnp::ListValue::GetValue
const std::vector< Value * > & GetValue() const
Will return the raw value.
Definition: ListValue.cpp:39
Hazelnp::Value
Abstract class for values.
Definition: Value.h:10
Hazelnp::ListValue::GetInt64
long long int GetInt64() const override
Throws HazelnuppValueNotConvertibleException.
Definition: ListValue.cpp:69
Hazelnp::ListValue::GetInt32
int GetInt32() const override
Throws HazelnuppValueNotConvertibleException.
Definition: ListValue.cpp:74
Hazelnp::ListValue::AddValue
void AddValue(const Value *value)
Will add this value to the list.
Definition: ListValue.cpp:33
Hazelnp::ListValue::~ListValue
~ListValue() override
Definition: ListValue.cpp:13
Hazelnp::ListValue::ListValue
ListValue()
Definition: ListValue.cpp:7
Hazelnp::ListValue::Deepcopy
Value * Deepcopy() const override
Will return a deeopopy of this object.
Definition: ListValue.cpp:23
Hazelnp::ListValue::GetFloat64
long double GetFloat64() const override
Throws HazelnuppValueNotConvertibleException.
Definition: ListValue.cpp:79
Hazelnp::ListValue
Specializations for list values (uses std::vector<Value*>)
Definition: ListValue.h:9
Value.h