Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:56:53

0001 #include <cstdlib>
0002 #include <iostream>
0003 
0004 #include "exceptions.h"
0005 #include "toolbox.h"
0006 #include "Options.h"
0007 
0008 #include "boost/filesystem.hpp"
0009 #include "boost/property_tree/ptree.hpp"
0010 #include "boost/property_tree/json_parser.hpp"
0011 
0012 using namespace std;
0013 using namespace AllInOneConfig;
0014 
0015 namespace pt = boost::property_tree;
0016 namespace fs = boost::filesystem;
0017 
0018 int single(int argc, char* argv[]) {
0019   // parse the command line
0020   Options options;
0021   options.helper(argc, argv);
0022   options.parser(argc, argv);
0023 
0024   pt::ptree main_tree;
0025   pt::read_json(options.config, main_tree);
0026 
0027   pt::ptree alignment = main_tree.get_child("alignment");
0028   pt::ptree validation = main_tree.get_child("validation");
0029 
0030   // just dump the content, to show that it can be used
0031   dump(alignment);
0032   dump(validation);
0033 
0034   return EXIT_SUCCESS;
0035 }
0036 
0037 #ifndef DOXYGEN_SHOULD_SKIP_THIS
0038 int main(int argc, char* argv[]) { return exceptions<single>(argc, argv); }
0039 #endif