Returns non-zero if given URL has been cached */
| 357 | |
| 358 | /* Returns non-zero if given URL has been cached */ |
| 359 | static int IsCached(const cc_string* url) { |
| 360 | cc_string mainPath; char mainBuffer[FILENAME_SIZE]; |
| 361 | cc_string altPath; char altBuffer[FILENAME_SIZE]; |
| 362 | cc_filepath mainStr, altStr; |
| 363 | |
| 364 | String_InitArray(mainPath, mainBuffer); |
| 365 | String_InitArray(altPath, altBuffer); |
| 366 | |
| 367 | MakeCachePath(&mainPath, &altPath, url); |
| 368 | Platform_EncodePath(&mainStr, &mainPath); |
| 369 | Platform_EncodePath(&altStr, &altPath); |
| 370 | |
| 371 | return File_Exists(&mainStr) || (altPath.length && File_Exists(&altStr)); |
| 372 | } |
| 373 | |
| 374 | /* Attempts to open the cached data stream for the given url */ |
| 375 | static cc_bool OpenCachedData(const cc_string* url, struct Stream* stream) { |
no test coverage detected