Jpp 20.0.0-rc.9-29-gccc23c492-D
the software that should make you happy
Loading...
Searching...
No Matches
Functions
JMergeTripod.cc File Reference

Auxiliary program to merge tripod files. More...

#include <iostream>
#include <iomanip>
#include <vector>
#include "JDetector/JTripod.hh"
#include "JSupport/JMeta.hh"
#include "Jeep/JContainer.hh"
#include "Jeep/JPrint.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 merge tripod files.

Author
mdejong

Definition in file JMergeTripod.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 21 of file JMergeTripod.cc.

22{
23 using namespace std;
24 using namespace JPP;
25
26 typedef JContainer< vector<JTripod> > container_type;
27
28 vector<string> inputFile;
29 string outputFile;
30 int debug;
31
32 try {
33
34 JParser<> zap("Auxiliary program to merge tripod files.");
35
36 zap['f'] = make_field(inputFile, "input file");
37 zap['o'] = make_field(outputFile, "output file");
38 zap['d'] = make_field(debug) = 1;
39
40 zap(argc, argv);
41 }
42 catch(const exception &error) {
43 FATAL(error.what() << endl);
44 }
45
46 container_type data;
47
48 data.comment.add(JMeta(argc, argv));
49
50 for (vector<string>::const_iterator i = inputFile.begin(); i != inputFile.end(); ++i) {
51
52 container_type buffer;
53
54 try {
55 load(*i, buffer);
56 }
57 catch(const JException& error) {
58 FATAL(error);
59 }
60
61 if (data.empty())
62 data = buffer;
63 else
64 copy(buffer.begin(), buffer.end(), back_inserter(data));
65 }
66
67 data.store(outputFile.c_str());
68}