#include #include #include /* * https://github.com/hjiang/jsonxx * */ #include "jsonxx/jsonxx.h" using namespace std; int main(int argc, char** argv) { ifstream ifs(argv[1]); string json_str((istreambuf_iterator(ifs)), (istreambuf_iterator())); jsonxx::Object o; o.parse(json_str); jsonxx::Array edges = o.get("edges"); jsonxx::Array::container::const_iterator it = edges.values().begin(), end = edges.values().end(); while (it != end) { jsonxx::Object e = (*it)->get(); string s = e.get("rule").substr(1, 4); if (s == "Goal") cerr << s << endl; ++it; } return 0; }