MCPcopy Create free account
hub / github.com/ZDoom/Raze / LoadCRCCache

Function LoadCRCCache

source/core/searchpaths.cpp:334–363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

332//==========================================================================
333
334static TArray<FileEntry> LoadCRCCache(void)
335{
336 auto cachepath = M_GetAppDataPath(false) + "/grpcrccache.txt";
337 FScanner sc;
338 TArray<FileEntry> crclist;
339
340 try
341 {
342 if (sc.OpenFile(cachepath.GetChars()))
343 {
344 while (sc.GetString())
345 {
346 crclist.Reserve(1);
347 auto &flentry = crclist.Last();
348 flentry.FileName = sc.String;
349 sc.MustGetNumber();
350 flentry.FileLength = sc.BigNumber;
351 sc.MustGetNumber();
352 flentry.FileTime = sc.BigNumber;
353 sc.MustGetNumber();
354 flentry.CRCValue = (unsigned)sc.BigNumber;
355 }
356 }
357 }
358 catch (CRecoverableError &)
359 {
360 // If there's a parsing error, return what we got and discard the rest.
361 }
362 return crclist;
363}
364
365//==========================================================================
366//

Callers 1

GrpScanFunction · 0.85

Calls 6

ReserveMethod · 0.80
MustGetNumberMethod · 0.80
M_GetAppDataPathFunction · 0.50
OpenFileMethod · 0.45
GetCharsMethod · 0.45
GetStringMethod · 0.45

Tested by

no test coverage detected