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

Function CheckCascBuildFileDirs

src/External/CascLib/src/CascFiles.cpp:1528–1559  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1526}
1527
1528DWORD CheckCascBuildFileDirs(CASC_BUILD_FILE & BuildFile, LPCTSTR szLocalPath)
1529{
1530 CASC_PATH<TCHAR> WorkPath(szLocalPath, NULL);
1531 DWORD dwLevelCount = 0;
1532
1533 // Clear the build file structure
1534 memset(&BuildFile, 0, sizeof(CASC_BUILD_FILE));
1535
1536 for(;;)
1537 {
1538 // Try all supported build file types
1539 for(size_t i = 0; i < _countof(BuildTypes); i++)
1540 {
1541 CASC_PATH<TCHAR> FilePath(WorkPath, BuildTypes[i].szFileName, NULL);
1542
1543 // If the file exists there, we found it
1544 if(CheckCascBuildFileExact(BuildFile, FilePath) == ERROR_SUCCESS)
1545 {
1546 return ERROR_SUCCESS;
1547 }
1548 }
1549
1550 // Try to cut off one path path. Don't go indefinitely.
1551 if((dwLevelCount > 5) || !WorkPath.CutLastPart())
1552 {
1553 break;
1554 }
1555 }
1556
1557 // None of the supported file names was found
1558 return ERROR_FILE_NOT_FOUND;
1559}
1560
1561DWORD CheckOnlineStorage(PCASC_OPEN_STORAGE_ARGS pArgs, CASC_BUILD_FILE & BuildFile, bool bOnlineStorage)
1562{

Callers 1

CascOpenStorageExFunction · 0.85

Calls 2

CheckCascBuildFileExactFunction · 0.85
CutLastPartMethod · 0.80

Tested by

no test coverage detected