Particle Identification and Tracking
cl_parse.h
Go to the documentation of this file.
1 //Copyright 2010 Thomas A Caswell
2 //tcaswell@uchicago.edu
3 //http://jfi.uchicago.edu/~tcaswell
4 //
5 //This program is free software; you can redistribute it and/or modify
6 //it under the terms of the GNU General Public License as published by
7 //the Free Software Foundation; either version 3 of the License, or (at
8 //your option) any later version.
9 //
10 //This program is distributed in the hope that it will be useful, but
11 //WITHOUT ANY WARRANTY; without even the implied warranty of
12 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 //General Public License for more details.
14 //
15 //You should have received a copy of the GNU General Public License
16 //along with this program; if not, see <http://www.gnu.org/licenses>.
17 
18 #include <string>
19 #include <stdexcept>
20 #include <getopt.h>
21 
22 namespace utilities
23 {
24 
25 
30 class CL_parse
31 {
32 public:
36  CL_parse(int argc,char * const argv[]);
40  void parse() throw(std::invalid_argument);
44  void get_fin(std::string & fin_str) const
45  {fin_str = fin_;}
49  void get_fout(std::string & fout_str) const
50  {fout_str = fout_;}
54  void get_fpram(std::string & fpram_str) const
55  {fpram_str = fpram_;}
59  void get_fdb(std::string & fdb_str) const
60  {if(found_db_)
61  fdb_str = fdb_;
62  else
63  throw std::invalid_argument("optional argument -d not passed in");
64  }
65 private:
66  std::string fin_;
67  std::string fout_;
68  std::string fpram_;
69  std::string fdb_;
70  bool found_db_;
71 
72  char * const* argv_;
73  const int argc_;
74 
75 };
76 }
77 
78 
79 
80