|
19 | 19 | #include "printers/printer.h" |
20 | 20 |
|
21 | 21 | #include <boost/algorithm/string.hpp> |
22 | | -#include <primitives/context.h> |
| 22 | +#include <primitives/emitter.h> |
23 | 23 |
|
24 | 24 | #include <memory> |
25 | 25 |
|
26 | 26 | extern const std::map<int, Check::Information> check_information; |
27 | 27 |
|
28 | 28 | class CheckParametersScopedWriter |
29 | 29 | { |
30 | | - CMakeContext &ctx; |
| 30 | + CMakeEmitter &ctx; |
31 | 31 | const CheckParameters &p; |
32 | 32 | bool with_headers; |
33 | 33 | public: |
34 | | - CheckParametersScopedWriter(CMakeContext &ctx, const CheckParameters &p, bool with_headers = false) |
| 34 | + CheckParametersScopedWriter(CMakeEmitter &ctx, const CheckParameters &p, bool with_headers = false) |
35 | 35 | : ctx(ctx), p(p), with_headers(with_headers) |
36 | 36 | { |
37 | 37 | if (with_headers) |
@@ -72,7 +72,7 @@ class CheckFunction : public Check |
72 | 72 | root[information.cppan_key].push_back(y); |
73 | 73 | } |
74 | 74 |
|
75 | | - void writeCheck(CMakeContext &ctx) const override |
| 75 | + void writeCheck(CMakeEmitter &ctx) const override |
76 | 76 | { |
77 | 77 | CheckParametersScopedWriter p(ctx, parameters); |
78 | 78 | ctx.addLine(information.function + "(" + getData() + " " + getVariable() + ")"); |
@@ -136,7 +136,7 @@ class CheckType : public Check |
136 | 136 |
|
137 | 137 | virtual ~CheckType() {} |
138 | 138 |
|
139 | | - void writeCheck(CMakeContext &ctx) const override |
| 139 | + void writeCheck(CMakeEmitter &ctx) const override |
140 | 140 | { |
141 | 141 | CheckParametersScopedWriter p(ctx, parameters, true); |
142 | 142 | ctx.addLine(information.function + "(\"" + getData() + "\" " + getVariable() + ")"); |
@@ -164,7 +164,7 @@ class CheckStructMember : public Check |
164 | 164 |
|
165 | 165 | virtual ~CheckStructMember() {} |
166 | 166 |
|
167 | | - void writeCheck(CMakeContext &ctx) const override |
| 167 | + void writeCheck(CMakeEmitter &ctx) const override |
168 | 168 | { |
169 | 169 | CheckParametersScopedWriter p(ctx, parameters); |
170 | 170 | ctx.addLine(information.function + "(\"" + struct_ + "\" \"" + getData() + "\" \""); |
@@ -274,7 +274,7 @@ class CheckSymbol : public Check |
274 | 274 |
|
275 | 275 | virtual ~CheckSymbol() {} |
276 | 276 |
|
277 | | - void writeCheck(CMakeContext &ctx) const override |
| 277 | + void writeCheck(CMakeEmitter &ctx) const override |
278 | 278 | { |
279 | 279 | CheckParametersScopedWriter p(ctx, parameters); |
280 | 280 | ctx.addLine(information.function + "(\"" + getData() + "\" \""); |
@@ -323,7 +323,7 @@ class CheckDecl : public Check |
323 | 323 | root[information.cppan_key].push_back(n); |
324 | 324 | } |
325 | 325 |
|
326 | | - void writeCheck(CMakeContext &ctx) const override |
| 326 | + void writeCheck(CMakeEmitter &ctx) const override |
327 | 327 | { |
328 | 328 | static const Strings headers = { |
329 | 329 | "HAVE_SYS_TYPES_H", |
|
0 commit comments