libtreestore

annotate src/treestorepp.h @ 0:740fec9866b1

treestore initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 11 Apr 2014 08:56:46 +0300
parents
children
rev   line source
nuclear@0 1 #ifndef TREESTOREPP_H_
nuclear@0 2 #define TREESTOREPP_H_
nuclear@0 3
nuclear@0 4 #include "treestore.h"
nuclear@0 5
nuclear@0 6 /// wraps a C ts_value in a convenient class
nuclear@0 7 class TSValue {
nuclear@0 8 private:
nuclear@0 9 ts_value *ctsv;
nuclear@0 10
nuclear@0 11 public:
nuclear@0 12 TSValue();
nuclear@0 13 ~TSValue();
nuclear@0 14
nuclear@0 15 TSValue(const TSValue &tsv);
nuclear@0 16 TSValue &operator =(const TSValue &tsv);
nuclear@0 17
nuclear@0 18 #ifdef TS_USE_CPP11
nuclear@0 19 TSValue(const TSValue &&tsv);
nuclear@0 20 TSValue &operator =(const TSValue &&tsv);
nuclear@0 21 #endif
nuclear@0 22
nuclear@0 23 bool set(const char *str);
nuclear@0 24 bool set_int(int inum);
nuclear@0 25 bool set_int(int count, ...);
nuclear@0 26 bool set_float(float fnum);
nuclear@0 27 bool set_float(int count, ...);
nuclear@0 28 bool set_array(int count, const TSValue &v0, ...);
nuclear@0 29
nuclear@0 30 const char *get() const;
nuclear@0 31
nuclear@0 32 int get_int() const;
nuclear@0 33 int *get_intv() const;
nuclear@0 34
nuclear@0 35 float get_float() const;
nuclear@0 36 float *get_floatv() const;
nuclear@0 37
nuclear@0 38 const TSValue *get_array() const;
nuclear@0 39 int get_array_size() const;
nuclear@0 40
nuclear@0 41 int get_vec_size() const; //< equiv: get_array_size */
nuclear@0 42 };
nuclear@0 43
nuclear@0 44 #endif // TREESTOREPP_H_