From 625269764ebbe8d0b566e6ef5fc26a6bccd4181d Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Sun, 13 Jul 2014 14:04:45 +0200 Subject: init --- cdec_json_parser/json_parse.cc | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 cdec_json_parser/json_parse.cc (limited to 'cdec_json_parser/json_parse.cc') diff --git a/cdec_json_parser/json_parse.cc b/cdec_json_parser/json_parse.cc new file mode 100644 index 0000000..4580fc8 --- /dev/null +++ b/cdec_json_parser/json_parse.cc @@ -0,0 +1,31 @@ +#include "json_parse.h" + +#include +#include + +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; +} + -- cgit v1.2.3