27 #include "rapidjson/document.h"
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();