-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariable.hpp
45 lines (35 loc) · 851 Bytes
/
variable.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef SRE_VARIABLE_HPP
#define SRE_VARIABLE_HPP
#include <memory>
namespace sre { namespace console {
class Variable
{
public:
enum TYPE {
STRING,
INT,
FLOAT,
CHAR
};
private:
std::string name;
Variable::TYPE type;
std::string val;
public:
Variable (std::string name, Variable::TYPE type, std::string val);
std::string toString();
void set (std::string value);
void set (int value);
void set (float value);
void set (char value);
std::string getName () {return name;}
std::string getVal () {return val;}
Variable::TYPE getType () {return type;}
std::string toStr();
int toInt();
float toFloat();
char toChar();
~Variable ();
};
}} // namespaces
#endif // SRE_VARIABLE_HPP