forked from MaskRay/ccls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiindexer.h
44 lines (36 loc) · 1.21 KB
/
iindexer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#pragma once
#include <optional.h>
#include <initializer_list>
#include <memory>
#include <string>
#include <vector>
// TODO:
// - rename indexer.h to clang_indexer.h and pull out non-clang specific code
// like IndexFile
// - rename this file to indexer.h
struct Config;
struct IndexFile;
struct FileContents;
struct FileConsumerSharedState;
struct PerformanceImportFile;
// Abstracts away the actual indexing process. Each IIndexer instance is
// per-thread and constructing an instance may be extremely expensive (ie,
// acquire a lock) and should be done as rarely as possible.
struct IIndexer {
struct TestEntry {
std::string path;
int num_indexes = 0;
TestEntry(const std::string& path, int num_indexes);
};
static std::unique_ptr<IIndexer> MakeClangIndexer();
static std::unique_ptr<IIndexer> MakeTestIndexer(
std::initializer_list<TestEntry> entries);
virtual ~IIndexer() = default;
virtual optional<std::vector<std::unique_ptr<IndexFile>>> Index(
Config* config,
FileConsumerSharedState* file_consumer_shared,
std::string file,
const std::vector<std::string>& args,
const std::vector<FileContents>& file_contents,
PerformanceImportFile* perf) = 0;
};