23#include <meteoio/thirdParty/picojson.h>
30 #pragma warning(disable:4512)
82 void setConnectionParams(
const std::string& i_proxy_url,
const int& i_http_timeout,
const bool& i_debug=
false);
83 void readAndParse(
const std::string& request,
const std::string& where);
85 static void printJSON(
const picojson::value& v,
const unsigned int& depth);
86 std::vector<picojson::value>
JSONQuery(
const std::string& path)
const;
87 picojson::value
goToJSONPath(
const std::string& path)
const;
89 std::string
getString(
const std::string& path)
const;
90 std::vector<std::string>
getStrings(
const std::string& path)
const;
91 double getDouble(
const std::string& path)
const;
92 std::vector<double>
getDoubles(
const std::string& path)
const;
95 static std::string indent(
const unsigned int& depth);
96 static void JSONQuery(
const std::string& path,
const picojson::value& v, std::vector<picojson::value>& results);
97 static picojson::value
goToJSONPath(
const std::string& path,
const picojson::value& v);
98 static size_t data_write(
void* buf,
const size_t size,
const size_t nmemb,
void* userp);
99 bool curl_read(
const std::string& url, std::ostream& os);
101 picojson::value json_tree;
103 std::string proxy_url;
106 static const int http_timeout_dflt;
This is a wrapper class around picoJson and Curl.
Definition: JsonWrapper.h:75
static void printJSON(const picojson::value &v, const unsigned int &depth)
Definition: JsonWrapper.cc:85
std::vector< double > getDoubles(const std::string &path) const
Definition: JsonWrapper.cc:221
std::vector< picojson::value > JSONQuery(const std::string &path) const
Definition: JsonWrapper.cc:143
double getDouble(const std::string &path) const
Definition: JsonWrapper.cc:209
JsonWrapper & operator=(const mio::JsonWrapper &)
Definition: JsonWrapper.cc:43
std::vector< std::string > getStrings(const std::string &path) const
Definition: JsonWrapper.cc:190
std::string getString(const std::string &path) const
Definition: JsonWrapper.cc:178
picojson::value goToJSONPath(const std::string &path) const
Definition: JsonWrapper.cc:113
~JsonWrapper()
Definition: JsonWrapper.cc:57
void readAndParse(const std::string &request, const std::string &where)
Definition: JsonWrapper.cc:240
JsonWrapper()
Definition: JsonWrapper.cc:34
void setConnectionParams(const std::string &i_proxy_url, const int &i_http_timeout, const bool &i_debug=false)
Set the connection parameters for CURL.
Definition: JsonWrapper.cc:68