Jpp  debug
the software that should make you happy
Functions
JSonPrint.cc File Reference

Auxiliary program to print (part of) JSon files. More...

#include <iostream>
#include <iomanip>
#include "JSon/JSon.hh"
#include "JSon/JPrinter.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Auxiliary program to print (part of) JSon files.

Author
mdejong

Definition in file JSonPrint.cc.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 17 of file JSonPrint.cc.

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 }
#define FATAL(A)
Definition: JMessage.hh:67
int debug
debug level
Definition: JSirene.cc:69
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:2158
Utility class to parse command line options.
Definition: JParser.hh:1714
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JSTDTypes.hh:14
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