#include #include #include #include "JDetector/JTripod.hh" #include "JSupport/JMeta.hh" #include "Jeep/JContainer.hh" #include "Jeep/JPrint.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Auxiliary program to merge tripod files. * * \author mdejong */ int main(int argc, char **argv) { using namespace std; using namespace JPP; typedef JContainer< vector > container_type; vector inputFile; string outputFile; int debug; try { JParser<> zap("Auxiliary program to merge tripod files."); zap['f'] = make_field(inputFile, "input file"); zap['o'] = make_field(outputFile, "output file"); zap['d'] = make_field(debug) = 1; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } container_type tripods; tripods.comment.add(JMeta(argc, argv)); for (vector::const_iterator i = inputFile.begin(); i != inputFile.end(); ++i) { container_type buffer; try { load(*i, buffer); } catch(const JException& error) { FATAL(error); } if (tripods.empty()) tripods = buffer; else copy(buffer.begin(), buffer.end(), back_inserter(tripods)); } tripods.store(outputFile.c_str()); }