#include <XMLUtils.h>
Public Types | |
typedef std::istream | Stream_t |
Public Member Functions | |
virtual unsigned int | curPos () const |
virtual unsigned int | readBytes (XMLByte *const buf, const unsigned int size) |
STLInputStream (std::istream &in) | |
virtual | ~STLInputStream () |
Private Attributes | |
std::istream & | in |
unsigned int | pos |
Definition at line 149 of file XMLUtils.h.
typedef std::istream lhef::STLInputStream::Stream_t |
Definition at line 151 of file XMLUtils.h.
lhef::STLInputStream::STLInputStream | ( | std::istream & | in | ) |
Definition at line 170 of file XMLUtils.cc.
: in(in) { if (in.bad()) throw cms::Exception("FileStreamError") << "I/O stream bad in STLInputStream::STLInputStream()" << std::endl; }
lhef::STLInputStream::~STLInputStream | ( | ) | [virtual] |
Definition at line 179 of file XMLUtils.cc.
{ }
virtual unsigned int lhef::STLInputStream::curPos | ( | ) | const [inline, virtual] |
unsigned int lhef::STLInputStream::readBytes | ( | XMLByte *const | buf, |
const unsigned int | size | ||
) | [virtual] |
Definition at line 183 of file XMLUtils.cc.
References i, in, pos, and SiPixelLorentzAngle_cfi::read.
{ char *rawBuf = reinterpret_cast<char*>(buf); unsigned int bytes = size * sizeof(XMLByte); in.read(rawBuf, bytes); unsigned int readBytes = in.gcount(); if (in.bad()) throw cms::Exception("FileStreamError") << "I/O stream bad in STLInputStream::readBytes()" << std::endl; unsigned int read = (unsigned int)(readBytes / sizeof(XMLByte)); unsigned int rest = (unsigned int)(readBytes % sizeof(XMLByte)); for(unsigned int i = 1; i <= rest; i++) in.putback(rawBuf[readBytes - i]); pos += read; return read; }
std::istream& lhef::STLInputStream::in [private] |
Definition at line 162 of file XMLUtils.h.
Referenced by readBytes().
unsigned int lhef::STLInputStream::pos [private] |
Definition at line 163 of file XMLUtils.h.
Referenced by curPos(), and readBytes().