summaryrefslogtreecommitdiff
path: root/lib/cdec_json_parser/json_parse.cc
blob: 4580fc813610536db0526e85aaa743f30a439748 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "json_parse.h"

#include <string>
#include <iostream>

using namespace std;


bool JSONParser::HandleJSONEvent(int type, const JSON_value* value) {
  switch(type) {
    case JSON_T_OBJECT_BEGIN:
    case JSON_T_OBJECT_END:
    case JSON_T_ARRAY_BEGIN:
    case JSON_T_ARRAY_END:
    case JSON_T_NULL:
    case JSON_T_TRUE:
    case JSON_T_FALSE:
    case JSON_T_KEY:
    case JSON_T_INTEGER:
    case JSON_T_FLOAT:
      break;
    case JSON_T_STRING:
      string s = value->vu.str.value;
      string t = s.substr(1, 4);
      if (t == "Goal")
        cerr << t << endl;
      break;
  }
  return true;
}