#include #include #include #include "JSon/JSon.hh" #include "JSon/JComparator.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Auxiliary program to compare (part of) JSon files. * \author mdejong */ int main(int argc, char **argv) { using namespace std; using namespace JPP; string ja; string jb; string outputFile; string key; int debug; try { JParser<> zap("Auxiliary program to compare (part of) JSon files."); zap['a'] = make_field(ja); zap['b'] = make_field(jb); zap['o'] = make_field(outputFile) = ""; zap['k'] = make_field(key) = ""; zap['d'] = make_field(debug) = 1; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } JSON::JComparator compare; json js = compare(JSon(ja), JSon(jb), key); DEBUG(setw(2) << js << endl); if (outputFile != "") { ofstream out(outputFile.c_str()); out << js; out.close(); } return (js.empty() ? 0 : 1); }