forked from cel-expr/cel-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcel_printer.cc
More file actions
38 lines (30 loc) · 1.23 KB
/
Copy pathcel_printer.cc
File metadata and controls
38 lines (30 loc) · 1.23 KB
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
#include "internal/cel_printer.h"
#include "google/protobuf/duration.pb.h"
#include "google/protobuf/timestamp.pb.h"
#include "absl/strings/str_cat.h"
namespace google {
namespace api {
namespace expr {
namespace internal {
constexpr const absl::string_view BaseJoinPolicy::kValueDelim;
constexpr const absl::string_view ListJoinPolicy::kStart;
constexpr const absl::string_view ListJoinPolicy::kEnd;
constexpr const absl::string_view SetJoinPolicy::kStart;
constexpr const absl::string_view SetJoinPolicy::kEnd;
constexpr const absl::string_view CallJoinPolicy::kStart;
constexpr const absl::string_view CallJoinPolicy::kEnd;
constexpr const absl::string_view MapJoinPolicy::kKeyDelim;
constexpr const absl::string_view ObjectJoinPolicy::kKeyDelim;
std::string ScalarPrinter::operator()(absl::Time value) {
return ToCallString(
google::protobuf::Timestamp::descriptor()->full_name(),
absl::FormatTime("%Y-%m-%dT%H:%M:%E*SZ", value, absl::UTCTimeZone()));
}
std::string ScalarPrinter::operator()(absl::Duration value) {
return ToCallString(google::protobuf::Duration::descriptor()->full_name(),
absl::FormatDuration(value));
}
} // namespace internal
} // namespace expr
} // namespace api
} // namespace google