forked from cel-expr/cel-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexpr_printer.h
More file actions
39 lines (29 loc) · 928 Bytes
/
Copy pathexpr_printer.h
File metadata and controls
39 lines (29 loc) · 928 Bytes
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
#ifndef THIRD_PARTY_CEL_CPP_TESTUTIL_EXPR_PRINTER_H_
#define THIRD_PARTY_CEL_CPP_TESTUTIL_EXPR_PRINTER_H_
#include <string>
#include "google/api/expr/v1alpha1/syntax.pb.h"
namespace google {
namespace api {
namespace expr {
namespace testutil {
using ::google::api::expr::v1alpha1::Expr;
class ExpressionAdorner {
public:
virtual ~ExpressionAdorner() {}
virtual std::string adorn(const Expr& e) const = 0;
virtual std::string adorn(const Expr::CreateStruct::Entry& e) const = 0;
};
const ExpressionAdorner& empty_adorner();
class ExprPrinter {
public:
ExprPrinter() : adorner_(empty_adorner()) {}
ExprPrinter(const ExpressionAdorner& adorner) : adorner_(adorner) {}
std::string print(const Expr& expr) const;
private:
const ExpressionAdorner& adorner_;
};
} // namespace testutil
} // namespace expr
} // namespace api
} // namespace google
#endif // THIRD_PARTY_CEL_CPP_TESTUTIL_EXPR_PRINTER_H_