See More

/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) // // See accompanying file COPYING.TXT file for licensing details. // /////////////////////////////////////////////////////////////////////////////// #include #include #include int main(int argc,char **argv) { using namespace cppcms; if(argc!=3) return 1; std::ifstream in(argv[2]); if(!in) return 1; json::value v; if(!v.load(in,true)) return 1; std::string path=argv[1]; try { std::cout<(path); return 0; } catch(json::bad_value_cast const &e) {} try { std::cout<(path); return 0; } catch(json::bad_value_cast const &e) {} try { std::cout<< (v.get(path) ? "true" : "false" ); return 0; } catch(json::bad_value_cast const &e) {} try { std::vector<:string> vs=v.get<:vector> >(path); std::string sep=""; for(unsigned i=0;i