本文整理汇总了C++中Dump::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ Dump::push_back方法的具体用法?C++ Dump::push_back怎么用?C++ Dump::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dump
的用法示例。
在下文中一共展示了Dump::push_back方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DecodeRLE
void DecodeRLE(const uint8_t* data, std::size_t size, Dump& result)
{
Dump tmp;
tmp.reserve(MAX_SECTOR_SIZE);
ByteStream stream(data, size);
while (!stream.Eof())
{
const uint_t len = 2 * stream.GetByte();
Require(!stream.Eof());
const uint_t count = stream.GetByte();
Require(count != 0);
const bool isRLE = len != 0;
const uint_t blockSize = isRLE ? len : count;
Require(stream.GetRestBytes() >= blockSize);
for (uint_t idx = 0; idx != blockSize; ++idx)
{
tmp.push_back(stream.GetByte());
}
if (isRLE)
{
Require(CopyFromBack(len, tmp, len * (count - 1)));
}
}
result.swap(tmp);
}
示例2: Require
void DecodeR2P(const uint8_t* data, std::size_t size, Dump& result)
{
Require(size % sizeof(R2PEntry) == 0);
Dump tmp;
tmp.reserve(MAX_SECTOR_SIZE);
for (const R2PEntry* it = safe_ptr_cast<const R2PEntry*>(data), *lim = it + size / sizeof(*it); it != lim; ++it)
{
const uint_t count = fromLE(it->Count);
Require(count != 0);
tmp.push_back(it->Data[0]);
tmp.push_back(it->Data[1]);
Require(CopyFromBack(sizeof(it->Data), tmp, sizeof(it->Data) * (count - 1)));
}
result.swap(tmp);
}