forked from Andersbakken/rtags
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GRTags.h
57 lines (53 loc) · 1.26 KB
/
GRTags.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
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef GRTags_h
#define GRTags_h
#include <rct/String.h>
#include "Location.h"
#include <rct/Map.h>
#include <rct/Path.h>
#include <leveldb/db.h>
#include <leveldb/comparator.h>
class GRTags
{
public:
GRTags();
bool exec(int argc, char **argv);
private:
enum Mode {
Create,
Detect,
Dump,
FindAll,
FindReferences,
FindSymbols,
ListSymbols,
Paths,
Update
};
enum Flag {
None = 0x0,
MatchCaseInsensitive = 0x1,
PreferExact = 0x2,
AbsolutePath = 0x4
};
void findSymbols(const String &pattern);
void listSymbols(const String &pattern);
void paths(const String &pattern);
bool load(const Path &db);
bool save();
void dump();
int parseFiles();
static Path::VisitResult visit(const Path &path, void *userData);
List<String> mFilters;
Map<uint32_t, time_t> mFiles;
// file id to last modified, time_t means currently parsing
Map<String, Map<Location, bool> > mSymbols;
// symbolName to Map<location, bool> bool == false means cursor, true means reference
leveldb::DB *mDB;
Path mPath;
Mode mMode;
unsigned mFlags;
unsigned mKeyFlags;
List<Path> mPending;
Set<uint32_t> mDirty;
};
#endif