本文整理汇总了C++中CBoolVector::IsEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ CBoolVector::IsEmpty方法的具体用法?C++ CBoolVector::IsEmpty怎么用?C++ CBoolVector::IsEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBoolVector
的用法示例。
在下文中一共展示了CBoolVector::IsEmpty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadPackInfo
void CInArchive::ReadPackInfo(
UInt64 &dataOffset,
CRecordVector<UInt64> &packSizes,
CBoolVector &packCRCsDefined,
CRecordVector<UInt32> &packCRCs)
{
dataOffset = ReadNumber();
CNum numPackStreams = ReadNum();
WaitAttribute(NID::kSize);
packSizes.Clear();
packSizes.Reserve(numPackStreams);
for (CNum i = 0; i < numPackStreams; i++)
packSizes.Add(ReadNumber());
UInt64 type;
for (;;)
{
type = ReadID();
if (type == NID::kEnd)
break;
if (type == NID::kCRC)
{
ReadHashDigests(numPackStreams, packCRCsDefined, packCRCs);
continue;
}
SkipData();
}
if (packCRCsDefined.IsEmpty())
{
BoolVector_Fill_False(packCRCsDefined, numPackStreams);
packCRCs.Reserve(numPackStreams);
packCRCs.Clear();
for (CNum i = 0; i < numPackStreams; i++)
packCRCs.Add(0);
}
}
示例2: ReadSubStreamsInfo
void CInArchive::ReadSubStreamsInfo(
const CObjectVector<CFolder> &folders,
CRecordVector<CNum> &numUnpackStreamsInFolders,
CRecordVector<UInt64> &unpackSizes,
CBoolVector &digestsDefined,
CRecordVector<UInt32> &digests)
{
numUnpackStreamsInFolders.Clear();
numUnpackStreamsInFolders.Reserve(folders.Size());
UInt64 type;
for (;;)
{
type = ReadID();
if (type == NID::kNumUnpackStream)
{
for (int i = 0; i < folders.Size(); i++)
numUnpackStreamsInFolders.Add(ReadNum());
continue;
}
if (type == NID::kCRC || type == NID::kSize)
break;
if (type == NID::kEnd)
break;
SkipData();
}
if (numUnpackStreamsInFolders.IsEmpty())
for (int i = 0; i < folders.Size(); i++)
numUnpackStreamsInFolders.Add(1);
int i;
for (i = 0; i < numUnpackStreamsInFolders.Size(); i++)
{
// v3.13 incorrectly worked with empty folders
// v4.07: we check that folder is empty
CNum numSubstreams = numUnpackStreamsInFolders[i];
if (numSubstreams == 0)
continue;
UInt64 sum = 0;
for (CNum j = 1; j < numSubstreams; j++)
if (type == NID::kSize)
{
UInt64 size = ReadNumber();
unpackSizes.Add(size);
sum += size;
}
unpackSizes.Add(folders[i].GetUnpackSize() - sum);
}
if (type == NID::kSize)
type = ReadID();
int numDigests = 0;
int numDigestsTotal = 0;
for (i = 0; i < folders.Size(); i++)
{
CNum numSubstreams = numUnpackStreamsInFolders[i];
if (numSubstreams != 1 || !folders[i].UnpackCRCDefined)
numDigests += numSubstreams;
numDigestsTotal += numSubstreams;
}
for (;;)
{
if (type == NID::kCRC)
{
CBoolVector digestsDefined2;
CRecordVector<UInt32> digests2;
ReadHashDigests(numDigests, digestsDefined2, digests2);
int digestIndex = 0;
for (i = 0; i < folders.Size(); i++)
{
CNum numSubstreams = numUnpackStreamsInFolders[i];
const CFolder &folder = folders[i];
if (numSubstreams == 1 && folder.UnpackCRCDefined)
{
digestsDefined.Add(true);
digests.Add(folder.UnpackCRC);
}
else
for (CNum j = 0; j < numSubstreams; j++, digestIndex++)
{
digestsDefined.Add(digestsDefined2[digestIndex]);
digests.Add(digests2[digestIndex]);
}
}
}
else if (type == NID::kEnd)
{
if (digestsDefined.IsEmpty())
{
BoolVector_Fill_False(digestsDefined, numDigestsTotal);
digests.Clear();
for (int i = 0; i < numDigestsTotal; i++)
digests.Add(0);
}
return;
}
else
SkipData();
type = ReadID();
//.........这里部分代码省略.........