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