mirror of
https://github.com/MaskRay/ccls.git
synced 2024-12-02 12:27:07 +00:00
23 lines
670 B
C
23 lines
670 B
C
|
#pragma once
|
||
|
|
||
|
#include "config.h"
|
||
|
|
||
|
#include <unordered_map>
|
||
|
|
||
|
// Manages loading caches from file paths for the indexer process.
|
||
|
struct CacheLoader {
|
||
|
explicit CacheLoader(Config* config);
|
||
|
|
||
|
IndexFile* TryLoad(const std::string& path);
|
||
|
|
||
|
// Takes the existing cache or loads the cache at |path|. May return nullptr
|
||
|
// if the cache does not exist.
|
||
|
std::unique_ptr<IndexFile> TryTakeOrLoad(const std::string& path);
|
||
|
|
||
|
// Takes the existing cache or loads the cache at |path|. Asserts the cache
|
||
|
// exists.
|
||
|
std::unique_ptr<IndexFile> TakeOrLoad(const std::string& path);
|
||
|
|
||
|
std::unordered_map<std::string, std::unique_ptr<IndexFile>> caches;
|
||
|
Config* config_;
|
||
|
};
|