#include <GeneratorInterface/LHEInterface/src/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 169 of file XMLUtils.cc.
References lat::endl().
00169 : 00170 in(in) 00171 { 00172 if (in.bad()) 00173 throw cms::Exception("FileStreamError") 00174 << "I/O stream bad in STLInputStream::STLInputStream()" 00175 << std::endl; 00176 }
lhef::STLInputStream::~STLInputStream | ( | ) | [virtual] |
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 182 of file XMLUtils.cc.
References lat::endl(), i, in, int, pos, and SiStripLorentzAngle_cfi::read.
00184 { 00185 char *rawBuf = reinterpret_cast<char*>(buf); 00186 unsigned int bytes = size * sizeof(XMLByte); 00187 in.read(rawBuf, bytes); 00188 unsigned int readBytes = in.gcount(); 00189 00190 if (in.bad()) 00191 throw cms::Exception("FileStreamError") 00192 << "I/O stream bad in STLInputStream::readBytes()" 00193 << std::endl; 00194 00195 unsigned int read = (unsigned int)(readBytes / sizeof(XMLByte)); 00196 unsigned int rest = (unsigned int)(readBytes % sizeof(XMLByte)); 00197 for(unsigned int i = 1; i <= rest; i++) 00198 in.putback(rawBuf[readBytes - i]); 00199 00200 pos += read; 00201 return read; 00202 }
std::istream& lhef::STLInputStream::in [private] |
unsigned int lhef::STLInputStream::pos [private] |