29 #if !defined(VREX_JSON_PARSER_H)
30 #define VREX_JSON_PARSER_H
38 #include <yajl/yajl_parse.h>
39 #include <yajl/yajl_gen.h>
51 list<varVal *> *array;
57 map<string, varVal *> parse(
const unsigned char *);
59 void newKey(
string keyName) { m_curKey = keyName; }
60 void newString(
string value) {
61 varVal *vv=
new varVal();
64 m_array->push_back(vv);
66 m_dict[m_curKey] = vv;
70 void newNull() { m_dict[m_curKey] =
new varVal(); }
71 void newBool(
bool value) {
72 varVal *vv=
new varVal();
75 m_array->push_back(vv);
77 m_dict[m_curKey] = vv;
82 varVal *vv=
new varVal();
83 vv->array=
new list<varVal *>;
85 m_array->push_back(vv);
86 m_arrays.push(m_array);
89 m_dict[m_curKey] = vv;
95 if(m_arrays.empty()==
false){
96 m_array=m_arrays.top();
106 map<string, varVal *> m_dict;
107 stack< list<varVal *> *> m_arrays;
108 list<varVal *> *m_array;