test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 21 of file EcalTrigPrimESProducer.cc.

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

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

Definition at line 42 of file EcalTrigPrimESProducer.cc.

References gzf.

43  { gzclose(gzf) ; }

Member Function Documentation

GzInputStream::operator bool ( ) const
inlineexplicit

Definition at line 44 of file EcalTrigPrimESProducer.cc.

References eof, and iss.

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

Definition at line 32 of file EcalTrigPrimESProducer.cc.

References buffer, eof, gzf, and iss.

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

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

Member Data Documentation

char GzInputStream::buffer[256]

Definition at line 18 of file EcalTrigPrimESProducer.cc.

Referenced by readLine().

bool GzInputStream::eof

Definition at line 20 of file EcalTrigPrimESProducer.cc.

Referenced by GzInputStream(), operator bool(), and readLine().

gzFile GzInputStream::gzf

Definition at line 17 of file EcalTrigPrimESProducer.cc.

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

std::istringstream GzInputStream::iss

Definition at line 19 of file EcalTrigPrimESProducer.cc.

Referenced by operator bool(), operator>>(), and readLine().