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::GzInputStream ( const char *  file)
inline

Definition at line 20 of file EcalTrigPrimESProducer.cc.

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  }

References eof, FrontierConditions_GlobalTag_cff::file, gzf, and readLine().

◆ ~GzInputStream()

GzInputStream::~GzInputStream ( )
inline

Definition at line 36 of file EcalTrigPrimESProducer.cc.

36 { gzclose(gzf); }

References gzf.

Member Function Documentation

◆ operator bool()

GzInputStream::operator bool ( ) const
inlineexplicit

Definition at line 37 of file EcalTrigPrimESProducer.cc.

37 { return ((eof == true) ? false : !iss.fail()); }

References eof, and iss.

◆ readLine()

void GzInputStream::readLine ( )
inline

Definition at line 28 of file EcalTrigPrimESProducer.cc.

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  }

References buffer, eof, gzf, and iss.

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

Member Data Documentation

◆ buffer

char GzInputStream::buffer[256]

Definition at line 17 of file EcalTrigPrimESProducer.cc.

Referenced by readLine().

◆ eof

bool GzInputStream::eof

Definition at line 19 of file EcalTrigPrimESProducer.cc.

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

◆ gzf

gzFile GzInputStream::gzf

Definition at line 16 of file EcalTrigPrimESProducer.cc.

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

◆ iss

std::istringstream GzInputStream::iss

Definition at line 18 of file EcalTrigPrimESProducer.cc.

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

GzInputStream::iss
std::istringstream iss
Definition: EcalTrigPrimESProducer.cc:18
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
GzInputStream::gzf
gzFile gzf
Definition: EcalTrigPrimESProducer.cc:16
FrontierConditions_GlobalTag_cff.file
file
Definition: FrontierConditions_GlobalTag_cff.py:13
res
Definition: Electron.h:6
GzInputStream::eof
bool eof
Definition: EcalTrigPrimESProducer.cc:19
GzInputStream::buffer
char buffer[256]
Definition: EcalTrigPrimESProducer.cc:17
GzInputStream::readLine
void readLine()
Definition: EcalTrigPrimESProducer.cc:28