CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 <string>
21 #include <fstream>
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:
38 
40  DTTPGLutFile(const std::string name = "" );
41 
43  DTTPGLutFile(const DTTPGLutFile& );
44 
46  virtual ~DTTPGLutFile();
47 
50 
52  inline std::string getName() const { return m_file; }
53 
55  int open();
56 
58  inline bool good() { return m_fin.good(); }
59 
61  inline bool bad() { return m_fin.bad(); }
62 
64  inline void close() { m_fin.close(); }
65 
67  void ignoreLines(int n);
68 
70  int readInteger();
71 
73  int readHex();
74 
77 
78  private:
79 
80  std::ifstream m_fin; // input file stream
81  std::string m_file; // file name
82 
83 };
84 
85 #endif
std::string getName() const
return filename
Definition: DTTPGLutFile.h:52
virtual ~DTTPGLutFile()
destructor
Definition: DTTPGLutFile.cc:50
void ignoreLines(int n)
read and ignore n lines from file
Definition: DTTPGLutFile.cc:79
std::string readString()
read one string from file
bool good()
return status of file stream
Definition: DTTPGLutFile.h:58
std::string m_file
Definition: DTTPGLutFile.h:81
bool bad()
return status of file stream
Definition: DTTPGLutFile.h:61
DTTPGLutFile & operator=(const DTTPGLutFile &)
assignment operator
Definition: DTTPGLutFile.cc:56
DTTPGLutFile(const std::string name="")
constructor
int readHex()
read one hex from file
Definition: DTTPGLutFile.cc:96
std::ifstream m_fin
Definition: DTTPGLutFile.h:80
int readInteger()
read one integer from file
Definition: DTTPGLutFile.cc:87
int open()
open file
Definition: DTTPGLutFile.cc:64
void close()
close file
Definition: DTTPGLutFile.h:64