Jpp  18.5.2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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

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 }
Utility class to parse command line options.
Definition: JParser.hh:1514
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1989
#define FATAL(A)
Definition: JMessage.hh:67
Auxiliary data structure to print (part of) JSon data.
Definition: JPrinter.hh:29
int debug
debug level