-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLblTree.h
68 lines (56 loc) · 1.3 KB
/
LblTree.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
58
59
60
61
62
63
64
65
66
67
68
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_DIFF_LBL_TREE_H
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_DIFF_LBL_TREE_H
#include <string>
namespace clang {
namespace diff {
enum TreeType {
HIDE_NOTHING = 0,
HIDE_ROOT_LABEL,
RENAME_LABELS_TO_LEVEL,
HIDE_ALL_LABELS,
RANDOM_ROOT_LABEL,
NO_NODE = -1,
NO_TREE_ID = -1
};
class LblTree
{
public:
LblTree(std::string* label, int treeID);
LblTree();
std::string* getLabel() const { return label; }
void setLabel(std::string* label) {
Label = label;
}
int getTreeID() const {
if(isRoot()) {
return treeID;
} else {
return (java_cast< LblTree* >(getRoot()))->getTreeID();
}
}
void setTreeID(int treeID) {
if(isRoot()) {
this->treeID = treeID;
} else {
(java_cast< LblTree* >(getRoot()))->setTreeID(treeID);
}
}
void* getTmpData() const { return TmpData; }
void setTmpData(void* tmpData) {
TmpData = tmpData;
}
void prettyPrint();
void prettyPrint(bool printTmpData);
int getNodeCount();
static LblTree* fromString(const std::string& s);
std::string toString() override;
virtual void clearTmpData();
private:
int TreeID;
std::string* Label;
void* TmpData;
int NodeID;
};
} // namespace diff
} // namespace clang
#endif