CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Public Attributes
GzInputStream Struct Reference

Public Types

typedef voidp gzFile
 

Public Member Functions

 GzInputStream (const char *file)
 
 operator void * ()
 
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.

Member Typedef Documentation

typedef voidp GzInputStream::gzFile

Definition at line 17 of file EcalTrigPrimESProducer.cc.

Constructor & Destructor Documentation

GzInputStream::GzInputStream ( const char *  file)
inline

Definition at line 22 of file EcalTrigPrimESProducer.cc.

References eof, gzf, readLine(), and funct::true.

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

Definition at line 43 of file EcalTrigPrimESProducer.cc.

References gzf.

44  { gzclose(gzf) ; }

Member Function Documentation

GzInputStream::operator void * ( )
inline

Definition at line 45 of file EcalTrigPrimESProducer.cc.

References eof, and iss.

46  { return ((eof==true)?((void*)0):iss) ; }
std::istringstream iss
void GzInputStream::readLine ( )
inline

Definition at line 33 of file EcalTrigPrimESProducer.cc.

References buffer, eof, gzf, and iss.

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

34  {
35  char * res = gzgets(gzf,buffer,256) ;
36  eof = (res==Z_NULL) ;
37  if (!eof)
38  {
39  iss.clear() ;
40  iss.str(buffer) ;
41  }
42  }
std::istringstream iss

Member Data Documentation

char GzInputStream::buffer[256]

Definition at line 19 of file EcalTrigPrimESProducer.cc.

Referenced by readLine().

bool GzInputStream::eof

Definition at line 21 of file EcalTrigPrimESProducer.cc.

Referenced by GzInputStream(), operator void *(), and readLine().

gzFile GzInputStream::gzf

Definition at line 18 of file EcalTrigPrimESProducer.cc.

Referenced by GzInputStream(), readLine(), and ~GzInputStream().

std::istringstream GzInputStream::iss

Definition at line 20 of file EcalTrigPrimESProducer.cc.

Referenced by operator void *(), operator>>(), and readLine().