File indexing completed on 2025-04-19 09:10:07
0001 #ifndef MODEL__UFO__UFO_Param_Reader_H
0002 #define MODEL__UFO__UFO_Param_Reader_H
0003
0004 #include <string>
0005 #include <vector>
0006
0007 namespace UFO{
0008
0009 class UFO_Param_Reader{
0010
0011 public:
0012 UFO_Param_Reader(const std::string& filepath);
0013 ~UFO_Param_Reader() {};
0014
0015 template<class Read_Type> Read_Type GetEntry(const std::string& block,
0016 const unsigned int& n,
0017 const unsigned int& m,
0018 const Read_Type& def,
0019 const bool& err=true);
0020 template<class Read_Type> Read_Type GetEntry(const std::string& block,
0021 const unsigned int& n,
0022 const Read_Type& def,
0023 const bool& err=true);
0024
0025 private:
0026 std::vector< std::vector<std::string> > m_lines;
0027 int m_use_runcard;
0028 template<class Read_Type> Read_Type GetWidth(const unsigned int& n,
0029 const Read_Type& def,
0030 const bool& err=true);
0031 template<class Read_Type> static Read_Type NotFound(const std::string& block,
0032 const unsigned int& n,
0033 const unsigned int& m,
0034 const Read_Type& def,
0035 const bool& err);
0036 template<class Read_Type> static Read_Type NotFound(const std::string& block,
0037 const unsigned int& n,
0038 const Read_Type& def,
0039 const bool& err);
0040 static bool IgnoreCaseCompare(const std::string& a, const std::string& b);
0041 std::vector< std::vector<std::string> >::const_iterator FindBlock(const std::string& block);
0042 };
0043 }
0044
0045 #endif