本文整理汇总了C++中CBoolVector类的典型用法代码示例。如果您正苦于以下问题:C++ CBoolVector类的具体用法?C++ CBoolVector怎么用?C++ CBoolVector使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CBoolVector类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadByte
void CInArchive::ReadBoolVector2(int numItems, CBoolVector &v)
{
Byte allAreDefined = ReadByte();
if (allAreDefined == 0)
{
ReadBoolVector(numItems, v);
return;
}
v.Clear();
v.Reserve(numItems);
for (int i = 0; i < numItems; i++)
v.Add(true);
}
示例2: ReadBoolVector
void CInArchive::ReadBoolVector(int numItems, CBoolVector &v)
{
v.Clear();
v.Reserve(numItems);
Byte b = 0;
Byte mask = 0;
for (int i = 0; i < numItems; i++)
{
if (mask == 0)
{
b = ReadByte();
mask = 0x80;
}
v.Add((b & mask) != 0);
mask >>= 1;
}
}
示例3: 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);
}
}
示例4: ReadID
HRESULT CInArchive::ReadHeader(
DECL_EXTERNAL_CODECS_LOC_VARS
CArchiveDatabaseEx &db
#ifndef _NO_CRYPTO
, ICryptoGetTextPassword *getTextPassword, bool &passwordIsDefined
#endif
)
{
UInt64 type = ReadID();
if (type == NID::kArchiveProperties)
{
ReadArchiveProperties(db.ArchiveInfo);
type = ReadID();
}
CObjectVector<CByteBuffer> dataVector;
if (type == NID::kAdditionalStreamsInfo)
{
HRESULT result = ReadAndDecodePackedStreams(
EXTERNAL_CODECS_LOC_VARS
db.ArchiveInfo.StartPositionAfterHeader,
db.ArchiveInfo.DataStartPosition2,
dataVector
#ifndef _NO_CRYPTO
, getTextPassword, passwordIsDefined
#endif
);
RINOK(result);
db.ArchiveInfo.DataStartPosition2 += db.ArchiveInfo.StartPositionAfterHeader;
type = ReadID();
}
CRecordVector<UInt64> unpackSizes;
CBoolVector digestsDefined;
CRecordVector<UInt32> digests;
if (type == NID::kMainStreamsInfo)
{
ReadStreamsInfo(&dataVector,
db.ArchiveInfo.DataStartPosition,
db.PackSizes,
db.PackCRCsDefined,
db.PackCRCs,
db.Folders,
db.NumUnpackStreamsVector,
unpackSizes,
digestsDefined,
digests);
db.ArchiveInfo.DataStartPosition += db.ArchiveInfo.StartPositionAfterHeader;
type = ReadID();
}
else
{
for (int i = 0; i < db.Folders.Size(); i++)
{
db.NumUnpackStreamsVector.Add(1);
CFolder &folder = db.Folders[i];
unpackSizes.Add(folder.GetUnpackSize());
digestsDefined.Add(folder.UnpackCRCDefined);
digests.Add(folder.UnpackCRC);
}
}
db.Files.Clear();
if (type == NID::kEnd)
return S_OK;
if (type != NID::kFilesInfo)
ThrowIncorrect();
CNum numFiles = ReadNum();
db.Files.Reserve(numFiles);
CNum i;
for (i = 0; i < numFiles; i++)
db.Files.Add(CFileItem());
db.ArchiveInfo.FileInfoPopIDs.Add(NID::kSize);
if (!db.PackSizes.IsEmpty())
db.ArchiveInfo.FileInfoPopIDs.Add(NID::kPackInfo);
if (numFiles > 0 && !digests.IsEmpty())
db.ArchiveInfo.FileInfoPopIDs.Add(NID::kCRC);
CBoolVector emptyStreamVector;
BoolVector_Fill_False(emptyStreamVector, (int)numFiles);
CBoolVector emptyFileVector;
CBoolVector antiFileVector;
CNum numEmptyStreams = 0;
for (;;)
{
UInt64 type = ReadID();
if (type == NID::kEnd)
break;
UInt64 size = ReadNumber();
size_t ppp = _inByteBack->_pos;
bool addPropIdToList = true;
bool isKnownType = true;
if (type > ((UInt32)1 << 30))
//.........这里部分代码省略.........
示例5: while
HRESULT CFolderOutStream2::ProcessEmptyFiles()
{
while (_currentIndex < _extractStatuses->Size() && _db->Files[_startIndex + _currentIndex].Size == 0)
{
OpenFile();
RINOK(CloseFileAndSetResult());
}
return S_OK;
}
示例6: CheckFinishedState
HRESULT CheckFinishedState() const { return (_currentIndex == _extractStatuses->Size()) ? S_OK: E_FAIL; }