Added return value to getFileReferences()

This commit is contained in:
Robert Osfield
2004-10-28 13:02:33 +00:00
parent 90e5586777
commit 70e636bf15

View File

@@ -83,6 +83,9 @@ Archive::IndexBlock* Archive::IndexBlock::read(std::istream& in)
bool Archive::IndexBlock::getFileReferences(FileNamePositionMap& indexMap)
{
if (!_data || _offsetOfNextAvailableSpace==0) return false;
bool valuesAdded = false;
unsigned char* ptr = _data;
unsigned char* end_ptr = _data + _offsetOfNextAvailableSpace;
while (ptr<end_ptr)
@@ -99,7 +102,10 @@ bool Archive::IndexBlock::getFileReferences(FileNamePositionMap& indexMap)
indexMap[filename] = position;
ptr += filename_size;
valuesAdded = true;
}
return valuesAdded;
}
void Archive::IndexBlock::write(std::ostream& out)