CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
GzInputStream Struct Reference

Public Member Functions

 GzInputStream (const char *file)
 
 operator bool () const
 
void readLine ()
 
 ~GzInputStream ()
 

Public Attributes

char buffer [256]
 
bool eof
 
gzFile gzf
 
std::istringstream iss
 

Detailed Description

Definition at line 15 of file EcalTrigPrimESProducer.cc.

Constructor & Destructor Documentation

GzInputStream::GzInputStream ( const char *  file)
inline

Definition at line 20 of file EcalTrigPrimESProducer.cc.

References readLine().

20  : eof(false) {
21  gzf = gzopen(file, "rb");
22  if (gzf == Z_NULL) {
23  eof = true;
24  edm::LogWarning("EcalTPG") << "Database file " << file << " not found!!!";
25  } else
26  readLine();
27  }
GzInputStream::~GzInputStream ( )
inline

Definition at line 36 of file EcalTrigPrimESProducer.cc.

36 { gzclose(gzf); }

Member Function Documentation

GzInputStream::operator bool ( ) const
inlineexplicit

Definition at line 37 of file EcalTrigPrimESProducer.cc.

37 { return ((eof == true) ? false : !iss.fail()); }
std::istringstream iss
void GzInputStream::readLine ( )
inline

Definition at line 28 of file EcalTrigPrimESProducer.cc.

Referenced by GzInputStream(), and operator>>().

28  {
29  char *res = gzgets(gzf, buffer, 256);
30  eof = (res == Z_NULL);
31  if (!eof) {
32  iss.clear();
33  iss.str(buffer);
34  }
35  }
Definition: Electron.h:6
std::istringstream iss

Member Data Documentation

char GzInputStream::buffer[256]

Definition at line 17 of file EcalTrigPrimESProducer.cc.

bool GzInputStream::eof

Definition at line 19 of file EcalTrigPrimESProducer.cc.

gzFile GzInputStream::gzf

Definition at line 16 of file EcalTrigPrimESProducer.cc.

std::istringstream GzInputStream::iss

Definition at line 18 of file EcalTrigPrimESProducer.cc.

Referenced by operator>>().