#include #include #include #include #include "libjson.h" // g++ -O2 -o memory_leak_test -lcurl -Ijson MemoryLeakTest.C -Wno-reorder json/Source/*.cpp std::string get_file_contents(const char *filename) { // http://stackoverflow.com/questions/2602013/read-whole-ascii-file-into-c-stdstring std::ifstream in(filename, std::ios::in | std::ios::binary); if (in) { std::string contents; in.seekg(0, std::ios::end); contents.resize(in.tellg()); in.seekg(0, std::ios::beg); in.read(&contents[0], contents.size()); in.close(); return(contents); } throw(errno); } static void verifyFile() { std::string raw = get_file_contents("sample_result.json"); int i = 0; while (true) { raw[0]; if (!libjson::is_valid(raw)) { std::cout<<"not valid"<symbols = explode(",", stockSymbolString); } } } catch (std::invalid_argument ex) { std::cerr<<"EXCEPTION in parse"<