28 #include "rapidjson/writer.h" 29 #include "rapidjson/prettywriter.h" 30 #include "rapidjson/stringbuffer.h" 31 #include "rapidjson/filereadstream.h" 36 #include "RemoteHttpResource.h" 40 #include "rjson_utils.h" 44 #define prolog std::string("rjson_utils::").append(__func__).append("() - ") 58 BESDEBUG(MODULE,prolog <<
"Trying url: " << url << endl);
63 stringstream msg(prolog);
64 msg <<
"CMR-Hits: "<< cmr_hits << endl;
68 char readBuffer[65536];
69 rapidjson::FileReadStream frs(fp, readBuffer,
sizeof(readBuffer));
87 bool result = itr !=
object.MemberEnd();
89 BESDEBUG(MODULE, prolog + (result?
"Located":
"FAILED to locate") +
" the value '"+name+
"' in object." << endl);
94 result = myValue.IsString();
95 BESDEBUG(MODULE, prolog +
"The value of '"+ name +
"' is " + (result?myValue.GetString():
" NOT a String type.") << endl);
99 return myValue.GetString();
111 rapidjson::StringBuffer buffer;
112 rapidjson::PrettyWriter<rapidjson::StringBuffer> writer(buffer);
114 return buffer.GetString();
static std::ostream * GetStrm()
return the debug stream
(Constant) member iterator for a JSON object value
std::string get_http_response_header(const std::string header_name)
GenericValue< UTF8<> > Value
GenericValue with UTF8 encoding.
GenericDocument< UTF8<> > Document
GenericDocument with UTF8 encoding.
std::string getCacheFileName()
static bool IsSet(const std::string &flagName)
see if the debug context flagName is set to true