Leonetienne/Hazelnupp
Simple, easy to use, command line parameter interface
IntValue.h
Go to the documentation of this file.
1 #pragma once
2 #include "Value.h"
3 
6 class IntValue : public Value
7 {
8 public:
9  IntValue(const long long int& value);
10  ~IntValue() override {};
11 
13  Value* Deepcopy() const override;
14 
16  std::string GetAsOsString() const override;
17 
19  const long long int& GetValue() const;
20 
21  operator long long int() const;
22  operator int() const;
23 
24 
26  long long int GetInt64() const override;
28  int GetInt32() const override;
29 
31  long double GetFloat64() const override;
33  double GetFloat32() const override;
34 
36  std::string GetString() const override;
37 
39  const std::vector<Value*>& GetList() const override;
40 
41 private:
42  long long int value;
43 };
IntValue::GetAsOsString
std::string GetAsOsString() const override
Will return a string suitable for an std::ostream;.
Definition: IntValue.cpp:18
IntValue::GetFloat32
double GetFloat32() const override
Will return the data as a double.
Definition: IntValue.cpp:57
IntValue
Specializations for integer values (uses long long int)
Definition: IntValue.h:6
Value
Abstract class for values.
Definition: Value.h:8
IntValue::GetValue
const long long int & GetValue() const
Will return the raw value.
Definition: IntValue.cpp:25
IntValue::IntValue
IntValue(const long long int &value)
Definition: IntValue.cpp:5
IntValue::~IntValue
~IntValue() override
Definition: IntValue.h:10
IntValue::GetInt32
int GetInt32() const override
Will return the data as an int.
Definition: IntValue.cpp:47
IntValue::GetFloat64
long double GetFloat64() const override
Will return the data as a long double.
Definition: IntValue.cpp:52
IntValue::GetString
std::string GetString() const override
Will return the data as a string.
Definition: IntValue.cpp:62
IntValue::Deepcopy
Value * Deepcopy() const override
Will return a deeopopy of this object.
Definition: IntValue.cpp:13
IntValue::GetList
const std::vector< Value * > & GetList() const override
Throws HazelnuppValueNotConvertibleException.
Definition: IntValue.cpp:70
IntValue::GetInt64
long long int GetInt64() const override
Will return the data as a long long int.
Definition: IntValue.cpp:42
Value.h