Inter4ql  5.2
Value.h
1 #ifndef __VALUE_H__
2 #define __VALUE_H__
3 
4 #include <string>
5 #include "Types.h"
6 
7 namespace Inter4ql {
8 
11  class Value {
12  public:
17  explicit Value(std::string s);
22  explicit Value(Value* value);
28  explicit Value(int i, Inter4ql::variable_type::type _type = Inter4ql::variable_type::INTEGER);
33  explicit Value(double d);
37  ~Value();
42  void set_value(std::string s);
48  void set_value(int i, Inter4ql::variable_type::type _type = Inter4ql::variable_type::INTEGER);
53  void set_value(double d);
58  std::string get_value_string() const;
63  double get_value_double() const;
68  int get_value_int() const;
73  bool is_numeric();
78  double get_value_numeric();
86  bool operator==(std::string &s);
89  bool operator==(int &i);
92  bool operator==(double &d);
95  bool operator==(Value &_v);
98  bool operator!=(Value &_v);
104  std::string print(bool type = true);
105  private:
106  void set_type(Inter4ql::variable_type::type _type);
107 
108  std::string value_string;
109  double value_double;
110  int value_int;
112  };
113 
114  bool operator<(const Value &a, const Value &b);
115  bool operator==(const Value &a, const Value &b);
116 
117 }
118 
119 #endif /* __VALUE_H__ */
120 
Inter4ql::variable_type::type get_type() const
getter for a value type
Definition: Value.cc:121
std::string get_value_string() const
getter for a string type value
Definition: Value.cc:58
void set_value(std::string s)
setter for string type value
Definition: Value.cc:81
Value(std::string s)
constructor with constructed string value
Definition: Value.cc:19
bool operator==(std::string &s)
string comparison
Definition: Value.cc:125
bool operator!=(Value &_v)
values comparison
Definition: Value.cc:149
Definition: Application.cc:37
int get_value_int() const
getter for an integer type value
Definition: Value.cc:68
Value class that handles different types of data.
Definition: Value.h:11
~Value()
destructor
Definition: Value.cc:32
bool is_numeric()
checks if value is numeric
Definition: Value.cc:45
type
Enumeration type for types of values.
Definition: Types.h:26
double get_value_numeric()
gives numeric value
Definition: Value.cc:49
double get_value_double() const
getter for a double type value
Definition: Value.cc:75
std::string print(bool type=true)
returns string with value information
Definition: Value.cc:187