本文整理汇总了C++中athena::io::IStreamReader::position方法的典型用法代码示例。如果您正苦于以下问题:C++ IStreamReader::position方法的具体用法?C++ IStreamReader::position怎么用?C++ IStreamReader::position使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类athena::io::IStreamReader
的用法示例。
在下文中一共展示了IStreamReader::position方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: nextBlock
MREA::StreamReader::StreamReader(athena::io::IStreamReader& source,
atUint32 blkCount, atUint32 secIdxCount)
: DNAMP2::MREA::StreamReader(source)
{
m_blkCount = blkCount;
m_blockInfos.reserve(blkCount);
for (atUint32 i=0 ; i<blkCount ; ++i)
{
m_blockInfos.emplace_back();
BlockInfo& info = m_blockInfos.back();
info.read(source);
m_totalDecompLen += info.decompSize;
}
source.seekAlign32();
m_secIdxs.reserve(secIdxCount);
for (atUint32 i=0 ; i<secIdxCount ; ++i)
{
m_secIdxs.emplace_back();
std::pair<DNAFourCC, atUint32>& idx = m_secIdxs.back();
idx.first.read(source);
idx.second = source.readUint32Big();
}
source.seekAlign32();
m_blkBase = source.position();
nextBlock();
}
示例2: read
void EmitterElementFactory::read(athena::io::IStreamReader& r)
{
uint32_t clsId;
r.readBytesToBuf(&clsId, 4);
switch (clsId)
{
case SBIG('SETR'):
m_elem.reset(new struct EESimpleEmitterTR);
break;
case SBIG('SEMR'):
m_elem.reset(new struct EESimpleEmitter);
break;
case SBIG('SPHE'):
m_elem.reset(new struct VESphere);
break;
case SBIG('ASPH'):
m_elem.reset(new struct VEAngleSphere);
break;
case SBIG('NONE'):
m_elem.reset();
return;
default:
m_elem.reset();
LogModule.report(logvisor::Fatal, "Unknown EmitterElement class %.4s @%" PRIi64, &clsId, r.position());
return;
}
m_elem->read(r);
}