| 33 | FileCache::~FileCache() = default; |
| 34 | |
| 35 | int FileCache::Find(const char* name) |
| 36 | { |
| 37 | for (int i = 0; i < _cache.Size(); i++) |
| 38 | { |
| 39 | const FileInCache* file = _cache[i]; |
| 40 | if (!strcmp(file->_name, name)) |
| 41 | { |
| 42 | return i; |
| 43 | } |
| 44 | } |
| 45 | return -1; |
| 46 | } |
| 47 | |
| 48 | void FileCache::MoveToFront(int index) |
| 49 | { |