Mercurial > hg > nsaunier > traffic-intelligence
comparison c/Parameters.cpp @ 1014:026f6b3b122c
Moving pull request2
| author | Wendlasida |
|---|---|
| date | Fri, 01 Jun 2018 17:32:52 -0400 |
| parents | 6c5ce3ec497e |
| children | 9fb82fe0156f |
comparison
equal
deleted
inserted
replaced
| 1013:d6f121ded971 | 1014:026f6b3b122c |
|---|---|
| 1 #include "Parameters.hpp" | 1 #include "Parameters.hpp" |
| 2 | 2 |
| 3 #include <boost/program_options.hpp> | 3 #include <boost/program_options.hpp> |
| 4 #include <boost/filesystem.hpp> | |
| 4 | 5 |
| 5 #include <iostream> | 6 #include <iostream> |
| 6 #include <fstream> | 7 #include <fstream> |
| 7 | 8 |
| 8 namespace po = boost::program_options; | 9 namespace po = boost::program_options; |
| 10 namespace fs = boost::filesystem; // soon std | |
| 11 | |
| 9 using namespace std; | 12 using namespace std; |
| 10 | 13 |
| 11 KLTFeatureTrackingParameters::KLTFeatureTrackingParameters(const int argc, char* argv[]) { | 14 KLTFeatureTrackingParameters::KLTFeatureTrackingParameters(const int argc, char* argv[]) { |
| 12 string configurationFilename; | 15 string configurationFilename; |
| 13 po::options_description onlyCmdLine("Command line only"); | 16 po::options_description onlyCmdLine("Command line only"); |
| 90 if (vm.count("config-file") == 0) { | 93 if (vm.count("config-file") == 0) { |
| 91 cout << "Missing configuration file" << endl; | 94 cout << "Missing configuration file" << endl; |
| 92 cout << cmdLine << endl; | 95 cout << cmdLine << endl; |
| 93 exit(0); | 96 exit(0); |
| 94 } | 97 } |
| 95 | 98 |
| 96 cout << "Using configuration file " << configurationFilename << endl; | 99 cout << "Using configuration file " << configurationFilename << endl; |
| 97 | 100 parentDirname = fs::path(configurationFilename).parent_path().string(); |
| 101 | |
| 98 ifstream configurationFile(configurationFilename.c_str()); | 102 ifstream configurationFile(configurationFilename.c_str()); |
| 99 store(po::parse_config_file(configurationFile, cmdLineAndFile, true), vm); | 103 store(po::parse_config_file(configurationFile, cmdLineAndFile, true), vm); |
| 100 notify(vm); | 104 notify(vm); |
| 101 | 105 |
| 102 parameterDescription = getParameterDescription(cmdLineAndFile, vm); | 106 parameterDescription = getParameterDescription(cmdLineAndFile, vm); |
