Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
JSonPrint.cc
Go to the documentation of this file.
1#include <iostream>
2#include <iomanip>
3
4#include "JSon/JSon.hh"
5#include "JSon/JPrinter.hh"
6
7#include "Jeep/JParser.hh"
8#include "Jeep/JMessage.hh"
9
10
11/**
12 * \file
13 *
14 * Auxiliary program to print (part of) JSon files.
15 * \author mdejong
16 */
17int main(int argc, char **argv)
18{
19 using namespace std;
20 using namespace JPP;
21
22 string js;
23 string key;
24 int debug;
25
26 try {
27
28 JParser<> zap("Auxiliary program to print (part of) JSon files.");
29
30 zap['f'] = make_field(js);
31 zap['k'] = make_field(key) = "";
32 zap['d'] = make_field(debug) = 1;
33
34 zap(argc, argv);
35 }
36 catch(const exception &error) {
37 FATAL(error.what() << endl);
38 }
39
40 JSON::JPrinter printer;
41
42 printer(cout, JSon(js), key);
43
44 return 0;
45}
General purpose messaging.
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
int main(int argc, char **argv)
Definition JSonPrint.cc:17
Utility class to parse command line options.
Definition JParser.hh:1698
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure to print (part of) JSon data.
Definition JPrinter.hh:29
Auxiliary class to load json data from file.
Definition JSon.hh:63