| 332 | //========================================================================== |
| 333 | |
| 334 | static 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 | // |
no test coverage detected