CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
lhef::STLInputStream Class Reference

#include <XMLUtils.h>

Inheritance diagram for lhef::STLInputStream:

Public Types

typedef std::istream Stream_t
 

Public Member Functions

XMLFilePos curPos () const override
 
const XMLCh * getContentType () const override
 
XMLSize_t readBytes (XMLByte *const buf, const XMLSize_t size) override
 
 STLInputStream (std::istream &in)
 
 ~STLInputStream () override
 

Private Attributes

std::istream & in
 
unsigned int pos
 

Detailed Description

Definition at line 142 of file XMLUtils.h.

Member Typedef Documentation

◆ Stream_t

typedef std::istream lhef::STLInputStream::Stream_t

Definition at line 144 of file XMLUtils.h.

Constructor & Destructor Documentation

◆ STLInputStream()

lhef::STLInputStream::STLInputStream ( std::istream &  in)

Definition at line 143 of file XMLUtils.cc.

143  : in(in) {
144  if (in.bad())
145  throw cms::Exception("FileStreamError") << "I/O stream bad in STLInputStream::STLInputStream()" << std::endl;
146  }

References in.

◆ ~STLInputStream()

lhef::STLInputStream::~STLInputStream ( )
override

Definition at line 148 of file XMLUtils.cc.

148 {}

Member Function Documentation

◆ curPos()

XMLFilePos lhef::STLInputStream::curPos ( ) const
inlineoverride

Definition at line 149 of file XMLUtils.h.

149 { return pos; }

References pos.

◆ getContentType()

const XMLCh* lhef::STLInputStream::getContentType ( ) const
inlineoverride

Definition at line 153 of file XMLUtils.h.

153 { return nullptr; }

◆ readBytes()

XMLSize_t lhef::STLInputStream::readBytes ( XMLByte *const  buf,
const XMLSize_t  size 
)
override

Definition at line 150 of file XMLUtils.cc.

150  {
151  char *rawBuf = reinterpret_cast<char *>(buf);
152  unsigned int bytes = size * sizeof(XMLByte);
153  in.read(rawBuf, bytes);
154  unsigned int readBytes = in.gcount();
155 
156  if (in.bad())
157  throw cms::Exception("FileStreamError") << "I/O stream bad in STLInputStream::readBytes()" << std::endl;
158 
159  unsigned int read = (unsigned int)(readBytes / sizeof(XMLByte));
160  unsigned int rest = (unsigned int)(readBytes % sizeof(XMLByte));
161  for (unsigned int i = 1; i <= rest; i++)
162  in.putback(rawBuf[readBytes - i]);
163 
164  pos += read;
165  return read;
166  }

References visDQMUpload::buf, mps_fire::i, in, createfilelist::int, readEcalDQMStatus::read, mergeAndRegister::rest, and findQualityFiles::size.

Member Data Documentation

◆ in

std::istream& lhef::STLInputStream::in
private

Definition at line 156 of file XMLUtils.h.

Referenced by readBytes(), and STLInputStream().

◆ pos

unsigned int lhef::STLInputStream::pos
private

Definition at line 157 of file XMLUtils.h.

Referenced by curPos().

mps_fire.i
i
Definition: mps_fire.py:428
pos
Definition: PixelAliasList.h:18
lhef::STLInputStream::readBytes
XMLSize_t readBytes(XMLByte *const buf, const XMLSize_t size) override
Definition: XMLUtils.cc:150
lhef::STLInputStream::pos
unsigned int pos
Definition: XMLUtils.h:157
createfilelist.int
int
Definition: createfilelist.py:10
visDQMUpload.buf
buf
Definition: visDQMUpload.py:160
readEcalDQMStatus.read
read
Definition: readEcalDQMStatus.py:38
mergeAndRegister.rest
rest
Definition: mergeAndRegister.py:120
lhef::STLInputStream::in
std::istream & in
Definition: XMLUtils.h:156
cms::Exception
Definition: Exception.h:70
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443