| 108 | } |
| 109 | |
| 110 | absl::Status Evaluate(absl::Span<const CelValue> args, CelValue* result, |
| 111 | google::protobuf::Arena* arena) const override { |
| 112 | if (args.size() != 2) { |
| 113 | return absl::InvalidArgumentError("Bad arguments number"); |
| 114 | } |
| 115 | |
| 116 | std::string concat = std::string(args[0].StringOrDie().value()) + |
| 117 | std::string(args[1].StringOrDie().value()); |
| 118 | |
| 119 | auto* concatenated = |
| 120 | google::protobuf::Arena::Create<std::string>(arena, std::move(concat)); |
| 121 | |
| 122 | *result = CelValue::CreateString(concatenated); |
| 123 | |
| 124 | return absl::OkStatus(); |
| 125 | } |
| 126 | }; |
| 127 | |
| 128 | class RecorderFunction : public CelFunction { |
no test coverage detected