nuclear@0: #ifndef TREESTOREPP_H_ nuclear@0: #define TREESTOREPP_H_ nuclear@0: nuclear@0: #include "treestore.h" nuclear@0: nuclear@0: /// wraps a C ts_value in a convenient class nuclear@0: class TSValue { nuclear@0: private: nuclear@0: ts_value *ctsv; nuclear@0: nuclear@0: public: nuclear@0: TSValue(); nuclear@0: ~TSValue(); nuclear@0: nuclear@0: TSValue(const TSValue &tsv); nuclear@0: TSValue &operator =(const TSValue &tsv); nuclear@0: nuclear@0: #ifdef TS_USE_CPP11 nuclear@0: TSValue(const TSValue &&tsv); nuclear@0: TSValue &operator =(const TSValue &&tsv); nuclear@0: #endif nuclear@0: nuclear@0: bool set(const char *str); nuclear@0: bool set_int(int inum); nuclear@0: bool set_int(int count, ...); nuclear@0: bool set_float(float fnum); nuclear@0: bool set_float(int count, ...); nuclear@0: bool set_array(int count, const TSValue &v0, ...); nuclear@0: nuclear@0: const char *get() const; nuclear@0: nuclear@0: int get_int() const; nuclear@0: int *get_intv() const; nuclear@0: nuclear@0: float get_float() const; nuclear@0: float *get_floatv() const; nuclear@0: nuclear@0: const TSValue *get_array() const; nuclear@0: int get_array_size() const; nuclear@0: nuclear@0: int get_vec_size() const; //< equiv: get_array_size */ nuclear@0: }; nuclear@0: nuclear@0: #endif // TREESTOREPP_H_