-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjson_cmp.cpp
More file actions
29 lines (29 loc) · 884 Bytes
/
json_cmp.cpp
File metadata and controls
29 lines (29 loc) · 884 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "data_encode.h"
#include <iostream>
#include <fstream>
using namespace std;
using namespace SA;
using json = nlohmann::json;
int main(int argc,char **argv) {
cout<<"argc:"<<argc<<endl;
if(argc != 3) {
cout<<"there must be 2 args"<<endl;
return 1;
}
cout<<argv[1]<<" "<<argv[2]<<endl;
ifstream f1(argv[1]),f2(argv[2]);
json data1 = json::parse(f1);
json data2 = json::parse(f2);
// cout<<setw(4)<<data1<<endl;
// cout<<setw(4)<<data2<<endl;
jsonFile file1 = data1;
jsonFile file2 = data2;
// cout<<"----------"<<argv[1]<<"------------"<<endl;
// file1.dumpJsonFile();
// cout<<"----------"<<argv[2]<<"------------"<<endl;
// file2.dumpJsonFile();
cout<<"-----------compare------------"<<endl;
// cout<<"result:"<<(file1==file2)<<endl;
jsonFile::DiffJsonFile(file1, file2);
return 0;
}