本文整理汇总了C++中ZStreamR::SkipAll方法的典型用法代码示例。如果您正苦于以下问题:C++ ZStreamR::SkipAll方法的具体用法?C++ ZStreamR::SkipAll怎么用?C++ ZStreamR::SkipAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZStreamR
的用法示例。
在下文中一共展示了ZStreamR::SkipAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: theStream
void ZASParser::ParseHandler_Prettify::ParsedBinary(const ZStreamR& iStream)
{
if (fDumpBinaries)
{
if (fInBlock)
spWriteIndent(fStrimW, fIndent);
// Let's see if we've got more than 16 bytes. We only have a read
// stream, so we can't _ask_ how many bytes would be physically
// readable (CountReadable only provides a lower limit, and
// can return zero even when there's data available). So we
// have to actually suck it and see. We use a ZStreamR_DynamicBuffered,
// which lets us read the stream, then return the read bytes to
// be re-read if it turns out we've got enough to warrant doing
// indentation.
ZStreamRWPos_RAM theStreamRAM;
ZStreamR_DynamicBuffered theStream(iStream, theStreamRAM);
uint64 countSkipped;
theStream.Skip(17, &countSkipped);
theStream.Rewind();
theStream.Commit();
if (countSkipped <= 16)
{
// We've got 16 or fewer bytes, emit them on the same line.
fStrimW.Write("binary { ");
ZStreamW_HexStrim(" ", "", 16, fStrimW).CopyAllFrom(theStream, nullptr, nullptr);
fStrimW.Write(" }\n");
}
else
{
// We've got more than 16 bytes, break them up into nice lines.
fStrimW.Write("binary\n");
spWriteIndent(fStrimW, fIndent + 1);
fStrimW.Write("{");
uint64 size;
string chunkSeparator = "\n" + string(fIndent + 1, '\t');
ZStreamW_HexStrim(" ", chunkSeparator, 16, fStrimW)
.CopyAllFrom(theStream, &size, nullptr);
fStrimW.Write("\n");
spWriteIndent(fStrimW, fIndent + 1);
fStrimW.Writef("} // %lld bytes\n", size);
}
}
else
{
uint64 size;
iStream.SkipAll(&size);
if (fInBlock)
spWriteIndent(fStrimW, fIndent);
fStrimW.Writef("binary { /* content not shown */ } // %d bytes\n", size);
}
}
示例2:
void ZASParser::ParseHandler::ParsedBinary(const ZStreamR& iStream)
{
// Just suck up and ignore the data
iStream.SkipAll(nil);
}