| 135 | } |
| 136 | |
| 137 | absl::StatusOr<absl::string_view> FormatList( |
| 138 | const Value& value, |
| 139 | const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool, |
| 140 | google::protobuf::MessageFactory* absl_nonnull message_factory, |
| 141 | google::protobuf::Arena* absl_nonnull arena, |
| 142 | std::string& scratch ABSL_ATTRIBUTE_LIFETIME_BOUND) { |
| 143 | CEL_ASSIGN_OR_RETURN(auto it, value.GetList().NewIterator()); |
| 144 | scratch.clear(); |
| 145 | scratch.push_back('['); |
| 146 | std::string value_scratch; |
| 147 | |
| 148 | while (it->HasNext()) { |
| 149 | CEL_ASSIGN_OR_RETURN(auto next, |
| 150 | it->Next(descriptor_pool, message_factory, arena)); |
| 151 | absl::string_view next_str; |
| 152 | value_scratch.clear(); |
| 153 | CEL_ASSIGN_OR_RETURN( |
| 154 | next_str, FormatString(next, descriptor_pool, message_factory, arena, |
| 155 | value_scratch)); |
| 156 | absl::StrAppend(&scratch, next_str); |
| 157 | absl::StrAppend(&scratch, ", "); |
| 158 | } |
| 159 | if (scratch.size() > 1) { |
| 160 | scratch.resize(scratch.size() - 2); |
| 161 | } |
| 162 | scratch.push_back(']'); |
| 163 | return scratch; |
| 164 | } |
| 165 | |
| 166 | absl::StatusOr<absl::string_view> FormatMap( |
| 167 | const Value& value, |
no test coverage detected