本文整理汇总了C++中common::ReadStream::err方法的典型用法代码示例。如果您正苦于以下问题:C++ ReadStream::err方法的具体用法?C++ ReadStream::err怎么用?C++ ReadStream::err使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common::ReadStream
的用法示例。
在下文中一共展示了ReadStream::err方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: read
bool SavePartVars::read(Common::ReadStream &stream) {
if (!_header.verify(stream))
return false;
if (stream.read(_data, _size) != _size)
return false;
return !stream.err();
}
示例2: DataBlockPtr
DataBlockPtr AdlEngine_v2::readDataBlockPtr(Common::ReadStream &f) const {
byte track = f.readByte();
byte sector = f.readByte();
byte offset = f.readByte();
byte size = f.readByte();
if (f.eos() || f.err())
error("Error reading DataBlockPtr");
if (track == 0 && sector == 0 && offset == 0 && size == 0)
return DataBlockPtr();
return _disk->getDataBlock(track, sector, offset, size);
}
示例3: verify
bool SaveHeader::verify(Common::ReadStream &stream) const {
// Compare the header with the stream's content
if (stream.readUint32BE() != kID1)
return false;
if (stream.readUint32BE() != kID2)
return false;
if (stream.readUint32BE() != _type)
return false;
if (stream.readUint32LE() != _version)
return false;
if (stream.readUint32LE() != _size)
return false;
return !stream.err();
}
示例4: verifyReadSize
bool SaveHeader::verifyReadSize(Common::ReadStream &stream) {
// Compare the header with the stream's content, expect for the size
if (stream.readUint32BE() != kID1)
return false;
if (stream.readUint32BE() != kID2)
return false;
if (stream.readUint32BE() != _type)
return false;
if (stream.readUint32LE() != _version)
return false;
// Read the size out of the stream instead
_size = stream.readUint32LE();
return !stream.err();
}
示例5: p
void Graphics_v1::drawCorners(Common::ReadStream &corners, const Common::Point &pos, byte rotation, byte scaling, byte color) const {
const byte stepping[] = {
0xff, 0xfe, 0xfa, 0xf4, 0xec, 0xe1, 0xd4, 0xc5,
0xb4, 0xa1, 0x8d, 0x78, 0x61, 0x49, 0x31, 0x18,
0xff
};
byte quadrant = rotation >> 4;
rotation &= 0xf;
byte xStep = stepping[rotation];
byte yStep = stepping[(rotation ^ 0xf) + 1] + 1;
Common::Point p(pos);
while (true) {
byte b = corners.readByte();
if (corners.eos() || corners.err())
error("Error reading corners");
if (b == 0)
return;
do {
byte xFrac = 0x80;
byte yFrac = 0x80;
for (uint j = 0; j < scaling; ++j) {
if (xFrac + xStep + 1 > 255)
drawCornerPixel(p, color, b, quadrant);
xFrac += xStep + 1;
if (yFrac + yStep > 255)
drawCornerPixel(p, color, b, quadrant + 1);
yFrac += yStep;
}
b >>= 3;
} while (b != 0);
}
}