MINT2
ParsedParameterFile.h
Go to the documentation of this file.
1 // author: Jonas Rademacker (Jonas.Rademacker@bristol.ac.uk)
2 // status: Mon 9 Feb 2009 19:17:56 GMT
3 #ifndef PARSED_PARAMETER_FILE
4 #define PARSED_PARAMETER_FILE
5 
6 #include <map>
7 #include <string>
8 #include <istream>
9 #include <iostream>
10 
12 
13 namespace MINT{
14 
16  protected:
17  static const ParsedParameterLine dummyLine;// will be invalid;
18  static const char _ignoreLinesStartingWith[];
19 
20  std::map<std::string, ParsedParameterLine> _lines;
21  bool _statusOK;
22 
23 
24  static bool ignoreThisLine(const std::string& line);
25  void readStream(std::istream& is);
26  public:
27  ParsedParameterFile(std::istream& inputStream = std::cin);
28  ParsedParameterFile(const std::string& fname);
30 
31  unsigned int numLines() const; // number of lines;
32  bool OK()const;
33 
34  const ParsedParameterLine& find(const std::string& name) const;
35 
36  void print(std::ostream& os=std::cout) const;
37 };
38 }// namespace MINT;
39 std::ostream& operator<<(std::ostream& os, const MINT::ParsedParameterFile& ppf);
40 
41 #endif
42 //
static const ParsedParameterLine dummyLine
void readStream(std::istream &is)
ParsedParameterFile(std::istream &inputStream=std::cin)
const ParsedParameterLine & find(const std::string &name) const
std::map< std::string, ParsedParameterLine > _lines
unsigned int numLines() const
void print(std::ostream &os=std::cout) const
static const char _ignoreLinesStartingWith[]
std::ostream & operator<<(std::ostream &os, const MINT::ParsedParameterFile &ppf)
static bool ignoreThisLine(const std::string &line)