1 #include <Poco/JSON/Object.h>
2 #include <Poco/JSON/Array.h>
3 #include <Poco/JSON/JSON.h>
4 #include <Poco/JSON/Stringifier.h>
5 #include <Poco/JSON/Parser.h>
6 #include <Poco/JSON/JSONException.h>
7 #include <Poco/Dynamic/Var.h>
31 Poco::JSON::Object::Ptr obj =
new Poco::JSON::Object();
35 std::stringstream ostr;
36 Poco::JSON::Stringifier::stringify(obj, ostr);
41 catch(std::exception& e)
57 Poco::JSON::Parser parser;
58 Poco::Dynamic::Var res = parser.parse(json);
59 Poco::JSON::Object::Ptr obj = res.extract<Poco::JSON::Object::Ptr>();
62 fetchType =
static_cast<FetchType>(convertVarToNumeric<unsigned int>(tmp, 0));
66 catch(Poco::JSON::JSONException& e)
72 catch(Poco::Exception& e)
89 is.seekg(0, std::ios::end);
90 json.resize(is.tellg());
91 is.seekg(0, std::ios::beg);
92 is.read(const_cast<char*>(json.c_str()), json.size());