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

Function GetFileSpanInfo

src/External/CascLib/src/CascFiles.cpp:1463–1492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1461}
1462
1463DWORD GetFileSpanInfo(PCASC_CKEY_ENTRY pCKeyEntry, PULONGLONG PtrContentSize, PULONGLONG PtrEncodedSize)
1464{
1465 ULONGLONG ContentSize = 0;
1466 ULONGLONG EncodedSize = 0;
1467 DWORD dwSpanCount = pCKeyEntry->SpanCount;
1468 bool bContentSizeError = false;
1469 bool bEncodedSizeError = false;
1470
1471 // Sanity check
1472 assert(pCKeyEntry->SpanCount != 0);
1473
1474 // Sum the file size over all file spans
1475 // Note: The first file span, if referenced by the ROOT folder, gets the same size
1476 // like the entire file (example: zone\base.xpak, zone\base.xpak_1)
1477 for(DWORD i = 0; i < dwSpanCount; i++, pCKeyEntry++)
1478 {
1479 if(pCKeyEntry->ContentSize == CASC_INVALID_SIZE)
1480 bContentSizeError = true;
1481 if(pCKeyEntry->EncodedSize == CASC_INVALID_SIZE)
1482 bEncodedSizeError = true;
1483
1484 ContentSize = ContentSize + pCKeyEntry->ContentSize;
1485 EncodedSize = EncodedSize + pCKeyEntry->EncodedSize;
1486 }
1487
1488 // Reset the sizes if there was an error
1489 PtrContentSize[0] = (bContentSizeError == false) ? ContentSize : CASC_INVALID_SIZE64;
1490 PtrEncodedSize[0] = (bEncodedSizeError == false) ? EncodedSize : CASC_INVALID_SIZE64;
1491 return dwSpanCount;
1492}
1493
1494DWORD CheckCascBuildFileExact(CASC_BUILD_FILE & BuildFile, LPCTSTR szLocalPath)
1495{

Callers 2

CopyCKeyEntryToFindDataFunction · 0.70
InitFileSpansMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected