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 class Input { 12 public: 13 Input(const string &, const string &default_fname = ""); 14 Input(const char*, const char* = ""); 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 private: 28 29 void trim_string(string *str); 30 31 void get_input_lines(vector<string> *, ifstream& ); 32 void build_map(map<string,string> *, vector<string> *); 33 34 map<string,string> *input_map; 35 map<string,string> *default_map; 36 37 vector<string> *input_text; 38 vector<string> *default_text; 39 40 }; 41 42 43 44 45 #endif 46