recordCleaner.cpp
Go to the documentation of this file.
1 
19 #include <string>
20 #include <algorithm>
21 #include <boost/program_options.hpp>
22 
23 using namespace ISM;
24 using namespace std;
25 namespace po = boost::program_options;
26 
27 int main (int argc, char** argv)
28 {
29  po::positional_options_description p;
30  p.add("database-file", -1);
31 
32  po::options_description desc("Allowed options");
33  desc.add_options()
34  ("help,h", "produce help message")
35  ("database-file,d", po::value<vector<string> >(), "database file")
36  ;
37 
38  po::variables_map vm;
39  po::store(po::command_line_parser(argc, argv).options(desc).positional(p).run(), vm);
40  po::notify(vm);
41 
42  if (vm.count("help") || !vm.count("database-file"))
43  {
44  cout << desc << "\n";
45  return 1;
46  }
47 
48  vector<string> databaseFiles = vm["database-file"].as<vector<string> >();
49 
50  cout<<"removing records from ";
51 
52  bool first = true;
53  for (string& database : databaseFiles)
54  {
55  if (!first)
56  {
57  cout<<",";
58  }
59  else
60  {
61  first = false;
62  }
63  cout<<database;
64  }
65  cout<<" ?"<<endl;
66  cout<<"Type yes to continue"<<endl;
67  string yes;
68  cin>>yes;
69  transform(yes.begin(), yes.end(), yes.begin(), ::tolower);
70  if (yes != "yes")
71  {
72  cout<<"aborting"<<endl;
73  return 1;
74  }
75 
76  //actual cleaning process
77  DataCleaner data_cleaner;
78  data_cleaner.cleanRecords(databaseFiles);
79 }
int main(int argc, char **argv)
void cleanRecords(const std::vector< std::string > &databaseFiles)
Definition: DataCleaner.hpp:46
this namespace contains all generally usable classes.


asr_lib_ism
Author(s): Hanselmann Fabian, Heller Florian, Heizmann Heinrich, Kübler Marcel, Mehlhaus Jonas, Meißner Pascal, Qattan Mohamad, Reckling Reno, Stroh Daniel
autogenerated on Wed Jan 8 2020 04:02:40