xref: /phasta/phSolver/common/Input.h (revision 3de22adcea938dcbea5f2b4ef2369694350775bd)
1 #ifndef H_Input
2 #define H_Input
3 #include <vector>
4 #include <string>
5 #include <map>
6 
7 #include "ValType.h"
8 
9 using namespace std;
10 
11 namespace phSolver{
12 class Input {
13 public:
14   Input(const string &, const string &default_fname = "");
15   ~Input();
16 
17   // return the entire input map
18   map<string,string> InputMap() const;
19 
20   // returns the desired string
21   //  const string &GetValue(const string &) const;
22   ValType GetValue(const string &) const;
23 
24   // echo the entire input map
25   void EchoInputMap(const ostream &ofile);
26 
27   const char* GetUserFileName();
28   const char* GetDefaultFileName();
29 private:
30 
31   void trim_string(string *str);
32 
33   void get_input_lines(vector<string> *, ifstream& );
34   void build_map(map<string,string> *, vector<string> *);
35 
36   map<string,string> *input_map;
37   map<string,string> *default_map;
38 
39   vector<string> *input_text;
40   vector<string> *default_text;
41 
42   string userConfFileName;
43   string defaultConfFileName;
44 
45 };
46 } //end phSolver namespace
47 
48 #endif
49