libtreestore

view src/treestorepp.h @ 2:e1a825be0eee

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