This class represent values in calculator.
You can find more information in comments below.
class CVariable
{
public:
virtual const String &getName() const; // Return name
VARIABLE_TYPE getType() const; // Return type
int getCount() const; // Return child item count
CVariable *getItem(const int index); // Return child item by index
CVariable *getItem(const String &name); // Return child item by name
// Constructors
CVariable(CVariable *parent = nullptr);
CVariable(const String &value, CVariable *parent = nullptr);
CVariable(const long long value, CVariable *parent = nullptr);
CVariable(const double value, CVariable *parent = nullptr);
CVariable(const bool value, CVariable *parent = nullptr);
CVariable(const VARIABLE_TYPE type, CVariable *parent = nullptr);
CVariable(const String &name, const String &value, CVariable *parent = nullptr);
CVariable(const String &name, const long long value, CVariable *parent = nullptr);
CVariable(const String &name, const double value, CVariable *parent = nullptr);
CVariable(const String &name, const bool value, CVariable *parent = nullptr);
CVariable(const String &name, const VARIABLE_TYPE type, CVariable *parent = nullptr);
virtual ~CVariable(); // Destructor
// Manage child items
void Add(CVariable *item);
CVariable *Add(const String &name);
CVariable *Add(const String &name, const String &value);
CVariable *Add(const String &name, const long long value);
CVariable *Add(const String &name, const double value);
void Delete(const int index);
void Delete(CVariable *item);
void Delete(const String &name);
void Clear();
// Clone and copy
CVariable *Clone() const;
void Copy(CVariable *dest) const;
// Assignment operators
const CVariable &operator=(const String &value);
const CVariable &operator=(const long long value);
const CVariable &operator=(const double value);
const CVariable &operator=(const bool value);
// Converting operators
operator String();
operator long long();
operator double();
operator bool();
};
Namespace: | nitisa::scripting |
Include: | Nitisa/Modules/Scripting/Variable.h |