MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / validatePath

Function validatePath

TheForceEngine/TFE_Settings/settings.cpp:1290–1305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1288 }
1289
1290 bool validatePath(const char* path, const char* sentinel)
1291 {
1292 if (!FileUtil::directoryExits(path)) { return false; }
1293
1294 char sentinelPath[TFE_MAX_PATH];
1295 sprintf(sentinelPath, "%s%s", path, sentinel);
1296 FileStream file;
1297 if (!file.open(sentinelPath, Stream::MODE_READ))
1298 {
1299 return false;
1300 }
1301 bool valid = file.getSize() > 1;
1302 file.close();
1303
1304 return valid;
1305 }
1306
1307 ////////////////////////////////////////////////////////////////////////////
1308 // Helper functions to determine valid HD assets.

Callers 3

autodetectGamePathsFunction · 0.70
getGogPathFromRegistryFunction · 0.50
getSteamPathFromRegistryFunction · 0.50

Calls 4

directoryExitsFunction · 0.50
openMethod · 0.45
getSizeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected