clang: include/clang/Tooling/Refactoring/AtomicChange.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef LLVM_CLANG_TOOLING_REFACTORING_ATOMICCHANGE_H
15#define LLVM_CLANG_TOOLING_REFACTORING_ATOMICCHANGE_H
16
20#include "llvm/ADT/Any.h"
21#include "llvm/ADT/StringRef.h"
22#include "llvm/Support/Error.h"
23
25namespace tooling {
26
27
28
29
30
31
32
33
34
35
36
38public:
39
40
41
42
44
46 llvm::Any Metadata);
47
48
49 AtomicChange(llvm::StringRef FilePath, llvm::StringRef Key)
50 : Key(Key), FilePath(FilePath) {}
51
54
57
59
60
62
63
65
66
67
68 const std::string &getKey() const { return Key; }
69
70
71 const std::string &getFilePath() const { return FilePath; }
72
73
74
75
76
77 void setError(llvm::StringRef Error) { this->Error = std::string(Error); }
78
79
80 bool hasError() const { return !Error.empty(); }
81
82
83 const std::string &getError() const { return Error; }
84
85
86
87
89 llvm::StringRef ReplacementText);
90
91
92
93
95 unsigned Length, llvm::StringRef Text);
96
97
98
99
100
101
102
103
104
106 llvm::StringRef Text, bool InsertAfter = true);
107
108
109
110
111 void addHeader(llvm::StringRef Header);
112
113
115
116
118
120
122 return InsertedHeaders;
123 }
124
126 return RemovedHeaders;
127 }
128
129 const llvm::Any &getMetadata() const { return Metadata; }
130
131private:
133
134 AtomicChange(std::string Key, std::string FilePath, std::string Error,
135 std::vectorstd::string InsertedHeaders,
136 std::vectorstd::string RemovedHeaders,
138
139
140 std::string Key;
141 std::string FilePath;
142 std::string Error;
143 std::vectorstd::string InsertedHeaders;
144 std::vectorstd::string RemovedHeaders;
146
147
148
149
150
151 llvm::Any Metadata;
152};
153
155
156
158
159
160
162
164
165
166
167
168
170
172};
173
174
175
176
177
178
179
180
181
182
183
188
189}
190}
191
192#endif
Various functions to configurably format source code.
Defines the SourceManager interface.
Represents a character-granular source range.
Encodes a location in the source.
This class handles loading and caching of source files into memory.
FormatStyle getNoStyle()
Returns style indicating formatting should be not applied at all.
The JSON file list parser is used to communicate input to InstallAPI.
@ Other
Other implicit parameter.
The FormatStyle is used to configure the formatting to follow specific guidelines.