clas12root
Loading...
Searching...
No Matches
jsonFileMerger.h
Go to the documentation of this file.
1#ifndef JSONFILEMERGER_H
2#define JSONFILEMERGER_H
3
4#include "rapidjson/document.h"
5#include "rapidjson/filereadstream.h"
6#include "rapidjson/filewritestream.h"
7#include "rapidjson/stringbuffer.h"
8#include "rapidjson/prettywriter.h"
9
10#include <string>
11#include <iostream>
12#include <vector>
13
14namespace clas12 {
15 using std::string;
16 using std::cout;
17 using std::endl;
18 using namespace rapidjson;
19
21
22 public:
23 jsonFileMerger()=default;
24 jsonFileMerger(std::string outFilePath){_outFilePath=outFilePath;};
25 virtual ~jsonFileMerger()=default;
26
27 void addFile(string file){_files.push_back(file);}
28 void mergeAllFiles();
29
30 private:
31 string _outFilePath;
32 std::vector<string> _files;
33 void mergeJsonFiles(Value& target, Value& source, Value::AllocatorType& allocator);
34 void writeJsonFile(Document &jsonDOM);
35 void print(Document &jsonDOM);
36 };
37}
38#endif /* JSONFILEMERGER_H */
jsonFileMerger(std::string outFilePath)
Definition jsonFileMerger.h:24
void mergeAllFiles()
Definition jsonFileMerger.cpp:8
virtual ~jsonFileMerger()=default
void addFile(string file)
Definition jsonFileMerger.h:27
Definition calextras.cpp:10