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 public:
38  DTTPGLutFile(const std::string name = "");
39 
41  DTTPGLutFile(const DTTPGLutFile &);
42 
44  virtual ~DTTPGLutFile();
45 
48 
50  inline std::string getName() const { return m_file; }
51 
53  int open();
54 
56  inline bool good() { return m_fin.good(); }
57 
59  inline bool bad() { return m_fin.bad(); }
60 
62  inline void close() { m_fin.close(); }
63 
65  void ignoreLines(int n);
66 
68  int readInteger();
69 
71  int readHex();
72 
75 
76 private:
77  std::ifstream m_fin; // input file stream
78  std::string m_file; // file name
79 };
80 
81 #endif
virtual ~DTTPGLutFile()
destructor
Definition: DTTPGLutFile.cc:49
void ignoreLines(int n)
read and ignore n lines from file
Definition: DTTPGLutFile.cc:71
std::string readString()
read one string from file
Definition: DTTPGLutFile.cc:89
bool good()
return status of file stream
Definition: DTTPGLutFile.h:56
std::string getName() const
return filename
Definition: DTTPGLutFile.h:50
std::string m_file
Definition: DTTPGLutFile.h:78
bool bad()
return status of file stream
Definition: DTTPGLutFile.h:59
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:83
std::ifstream m_fin
Definition: DTTPGLutFile.h:77
int readInteger()
read one integer from file
Definition: DTTPGLutFile.cc:77
int open()
open file
Definition: DTTPGLutFile.cc:60
void close()
close file
Definition: DTTPGLutFile.h:62