Jpp
18.3.0
the software that should make you happy
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
software
JSon
JSonDiff.cc
Go to the documentation of this file.
1
#include <iostream>
2
#include <iomanip>
3
#include <fstream>
4
5
#include "
JSon/JSon.hh
"
6
#include "
JSon/JComparator.hh
"
7
8
#include "
Jeep/JParser.hh
"
9
#include "
Jeep/JMessage.hh
"
10
11
12
/**
13
* \file
14
*
15
* Auxiliary program to compare (part of) JSon files.
16
* \author mdejong
17
*/
18
int
main
(
int
argc,
char
**argv)
19
{
20
using namespace
std;
21
using namespace
JPP;
22
23
string
ja;
24
string
jb;
25
string
outputFile
;
26
string
key;
27
int
debug
;
28
29
try
{
30
31
JParser<>
zap(
"Auxiliary program to compare (part of) JSon files."
);
32
33
zap[
'a'
] =
make_field
(ja);
34
zap[
'b'
] =
make_field
(jb);
35
zap[
'o'
] =
make_field
(
outputFile
) =
""
;
36
zap[
'k'
] =
make_field
(key) =
""
;
37
zap[
'd'
] =
make_field
(
debug
) = 1;
38
39
zap(argc, argv);
40
}
41
catch
(
const
exception &error) {
42
FATAL
(error.what() << endl);
43
}
44
45
JSON::JComparator
compare;
46
47
json
js = compare(JSon(ja), JSon(jb), key);
48
49
DEBUG
(setw(2) << js << endl);
50
51
if
(
outputFile
!=
""
) {
52
53
ofstream out(
outputFile
.c_str());
54
55
out << js;
56
57
out.close();
58
}
59
60
return
(js.empty() ? 0 : 1);
61
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1514
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
JSon.hh
outputFile
string outputFile
Definition:
JDAQTimesliceSelector.cc:37
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1989
JSON::JComparator
Auxiliary data structure to compare (part of) JSon data.
Definition:
JSon/JComparator.hh:29
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JComparator.hh
JParser.hh
Utility class to parse command line options.
json
nlohmann::json json
Definition:
JSupernovaMonitor.cc:28
debug
int debug
debug level
Definition:
archive-put-wiki-detectors.sh:92
DEBUG
#define DEBUG(A)
Message macros.
Definition:
JMessage.hh:62
Generated by
1.8.5