32 #include <json/json.h>
33 #include <json/value.h>
46 int main(
int argc,
char** argv)
48 std::cout <<
"AppJSONTests" << std::endl;
55 bool parsingSuccessful = reader.parse( FileHelpers::getFileString(
"controlVars.json"), root );
56 if ( !parsingSuccessful )
59 std::cout <<
"Failed to parse configuration\n"
60 << reader.getFormattedErrorMessages();
65 Json::Value CPGVals = root.get(
"CPGVals",
"UTF-8");
67 std::cout << CPGVals.size() <<
" " << CPGVals[0].size()<< std::endl;
69 Json::Value::iterator CPGIt = CPGVals.begin();
71 std::vector<double> CPGVect;
73 for(CPGIt = CPGVals.begin(); CPGIt != CPGVals.end(); CPGIt++)
75 std::cout << *CPGIt << std::endl;
76 CPGVect.push_back((*CPGIt)[0].asDouble());
79 std::cout << CPGVals << std::endl;
81 for(std::size_t i = 0; i < CPGVect.size(); i++)
83 std::cout << CPGVect[i] <<
" ";
86 std::cout << std::endl;
int main(int argc, char **argv)
A series of functions to assist with file input/output.