CMS 3D CMS Logo

DTTPGLutFile.h
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
11 //
12 //--------------------------------------------------
13 #ifndef DTTPG_LUT_FILE_H
14 #define DTTPG_LUT_FILE_H
15 
16 //---------------
17 // C++ Headers --
18 //---------------
19 
20 #include <fstream>
21 #include <string>
22 
23 //----------------------
24 // Base Class Headers --
25 //----------------------
26 
27 //------------------------------------
28 // Collaborating Class Declarations --
29 //------------------------------------
30 
31 // ---------------------
32 // -- Class Interface --
33 // ---------------------
34 
35 class DTTPGLutFile {
36 
37 public:
39  DTTPGLutFile(const std::string name = "");
40 
42  DTTPGLutFile(const DTTPGLutFile &);
43 
45  virtual ~DTTPGLutFile();
46 
49 
51  inline std::string getName() const { return m_file; }
52 
54  int open();
55 
57  inline bool good() { return m_fin.good(); }
58 
60  inline bool bad() { return m_fin.bad(); }
61 
63  inline void close() { m_fin.close(); }
64 
66  void ignoreLines(int n);
67 
69  int readInteger();
70 
72  int readHex();
73 
76 
77 private:
78  std::ifstream m_fin; // input file stream
79  std::string m_file; // file name
80 };
81 
82 #endif
std::string getName() const
return filename
Definition: DTTPGLutFile.h:51
virtual ~DTTPGLutFile()
destructor
Definition: DTTPGLutFile.cc:49
void ignoreLines(int n)
read and ignore n lines from file
Definition: DTTPGLutFile.cc:73
std::string readString()
read one string from file
Definition: DTTPGLutFile.cc:94
bool good()
return status of file stream
Definition: DTTPGLutFile.h:57
std::string m_file
Definition: DTTPGLutFile.h:79
bool bad()
return status of file stream
Definition: DTTPGLutFile.h:60
DTTPGLutFile & operator=(const DTTPGLutFile &)
assignment operator
Definition: DTTPGLutFile.cc:55
DTTPGLutFile(const std::string name="")
constructor
int readHex()
read one hex from file
Definition: DTTPGLutFile.cc:87
std::ifstream m_fin
Definition: DTTPGLutFile.h:78
int readInteger()
read one integer from file
Definition: DTTPGLutFile.cc:80
int open()
open file
Definition: DTTPGLutFile.cc:61
void close()
close file
Definition: DTTPGLutFile.h:63