| 54 | } |
| 55 | |
| 56 | bool tryParseCacheFileName(const String & file_name, String & key, UInt64 & file_size) |
| 57 | { |
| 58 | if (!endsWith(file_name, ".idx")) |
| 59 | return false; |
| 60 | String escaped_key; |
| 61 | ReadBufferFromString buf(file_name); |
| 62 | readIntText(file_size, buf); |
| 63 | assertChar('_', buf); |
| 64 | readStringUntilEOF(escaped_key, buf); |
| 65 | escaped_key.resize(escaped_key.size() - 4); /// remove ".idx" tail |
| 66 | key = unescapeForFileName(escaped_key); |
| 67 | return true; |
| 68 | } |
| 69 | |
| 70 | enum class CacheState |
| 71 | { |
no test coverage detected