5 class Myexcept
: public std::exception
8 Myexcept(std::string message
)
10 ~Myexcept() throw(){};
11 const char* what() const throw()
13 return message
.c_str();
21 std::string json
= "{\"batchcomplete\":\"\",\"query\":{\"normalized\":[{\"from\":\"Amundsen_Basin\",\"to\":\"Amundsen Basin\"}],\"pages\":{\"37082520\":{\"pageid\":37082520,\"ns\":0,\"title\":\"Amundsen Basin\",\"links\":[{\"ns\":0,\"title\":\"Abyssal\"},{\"ns\":0,\"title\":\"Arctic\"},{\"ns\":0,\"title\":\"Arctic Ocean\"},{\"ns\":0,\"title\":\"Cenozoic\"},{\"ns\":0,\"title\":\"Eurasian Basin\"},{\"ns\":0,\"title\":\"Gakkel Ridge\"},{\"ns\":0,\"title\":\"Lomonosov Ridge\"},{\"ns\":0,\"title\":\"Nansen Basin\"},{\"ns\":0,\"title\":\"Roald Amundsen\"},{\"ns\":0,\"title\":\"Seafloor spreading\"},{\"ns\":0,\"title\":\"Wilkes Basin\"}]}}}}";
24 std::istringstream
jsondatastream(json
);
25 jsondatastream
>> document
;
26 bool success
= true; //reader.parse(json, document, false);
29 throw Myexcept("Error parsing JSON");