本文整理汇总了C++中PDBFile::getStreamByteSize方法的典型用法代码示例。如果您正苦于以下问题:C++ PDBFile::getStreamByteSize方法的具体用法?C++ PDBFile::getStreamByteSize怎么用?C++ PDBFile::getStreamByteSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PDBFile
的用法示例。
在下文中一共展示了PDBFile::getStreamByteSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dumpStreamData
static void dumpStreamData(ScopedPrinter &P, PDBFile &File) {
uint32_t StreamCount = File.getNumStreams();
StringRef DumpStreamStr = opts::DumpStreamData;
uint32_t DumpStreamNum;
if (DumpStreamStr.getAsInteger(/*Radix=*/0U, DumpStreamNum) ||
DumpStreamNum >= StreamCount)
return;
uint32_t StreamBytesRead = 0;
uint32_t StreamSize = File.getStreamByteSize(DumpStreamNum);
auto StreamBlocks = File.getStreamBlockList(DumpStreamNum);
for (uint32_t StreamBlockAddr : StreamBlocks) {
uint32_t BytesLeftToReadInStream = StreamSize - StreamBytesRead;
if (BytesLeftToReadInStream == 0)
break;
uint32_t BytesToReadInBlock = std::min(
BytesLeftToReadInStream, static_cast<uint32_t>(File.getBlockSize()));
auto StreamBlockData =
File.getBlockData(StreamBlockAddr, BytesToReadInBlock);
outs() << StreamBlockData;
StreamBytesRead += StreamBlockData.size();
}
}
示例2: dumpStreamSizes
static void dumpStreamSizes(ScopedPrinter &P, PDBFile &File) {
if (!opts::DumpStreamSizes)
return;
ListScope L(P, "StreamSizes");
uint32_t StreamCount = File.getNumStreams();
for (uint32_t StreamIdx = 0; StreamIdx < StreamCount; ++StreamIdx) {
std::string Name("Stream ");
Name += to_string(StreamIdx);
P.printNumber(Name, File.getStreamByteSize(StreamIdx));
}
}