Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:14:23

0001 /**
0002    This parser is really fragile!!
0003  */
0004 
0005 #ifndef trivialParser_h
0006 #define trivialParser_h
0007 
0008 #include <string>
0009 #include <map>
0010 #include <fstream>
0011 
0012 class trivialParser {
0013 public:
0014   //!ctor
0015   explicit trivialParser(std::string configFile);
0016   //! return the value for that parameter
0017   double getVal(std::string name);
0018 
0019 private:
0020   //! container for the output
0021   std::map<std::string, double> m_config;
0022 
0023 private:
0024   //! parse the cfg file
0025   void parse(std::string configFile);
0026   //! print the read params
0027   void print(std::string prefix = "");
0028   //! returns the next not commented line
0029   std::string getNextLine(std::ifstream& input);
0030   //! get rid of spaces
0031   void eraseSpaces(std::string& word);
0032 };
0033 
0034 #endif