MCPcopy Create free account
hub / github.com/Scobalula/Greyhound / PartStream_CheckFile

Function PartStream_CheckFile

src/External/CascLib/src/common/FileStream.cpp:1493–1516  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1491}
1492
1493static DWORD PartStream_CheckFile(TBlockStream * pStream)
1494{
1495 PPART_FILE_MAP_ENTRY FileBitmap = (PPART_FILE_MAP_ENTRY)pStream->FileBitmap;
1496 DWORD dwBlockCount;
1497
1498 // Get the number of blocks
1499 dwBlockCount = (DWORD)((pStream->StreamSize + pStream->BlockSize - 1) / pStream->BlockSize);
1500
1501 // Check all blocks
1502 for(DWORD i = 0; i < dwBlockCount; i++, FileBitmap++)
1503 {
1504 // Few sanity checks
1505 assert(FileBitmap->LargeValueHi == 0);
1506 assert(FileBitmap->LargeValueLo == 0);
1507 assert(FileBitmap->Flags == 0 || FileBitmap->Flags == 3);
1508
1509 // Check if this block is present
1510 if(FileBitmap->Flags != 3)
1511 return 0;
1512 }
1513
1514 // Yes, the file is complete
1515 return 1;
1516}
1517
1518static bool PartStream_LoadBitmap(TBlockStream * pStream)
1519{

Callers 1

PartStream_LoadBitmapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected