Lite and Handy JSON parser
# Genereate example json
./gen_big_json.sh
# Compile
g++ -O2 --std=c++11 src/*.cxx tests/testTxJSON.cxx -o testjson
# test
./testjson > out.txt
ln -sf example_big.json example.json
time ./testjson > out.txt
string json_string = R"({ "123":[ 2, 3, 4, "abc", { "453":"123", "abc":456 } ] })";
TxJSON j(json_string);
if( j.Compile() ){
auto &d = j.GetDict();
cout<<d.Str()<<endl;
cout<<d["123"][4]["abc"].GetInt()<<endl;
}
TxJSON j;
if( j.LoadFile( "example.json" ) ){
auto &d = j.GetDict();
cout<<d.Str(1)<<endl
cout<<
}else{
cout<<"Error while loading file "<<j.GetErrorStr(j.GetStatus())<<endl;
}