MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / LookupInContainer

Function LookupInContainer

eval/eval/container_access_step.cc:202–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200}
201
202void LookupInContainer(const Value& container, const Value& key,
203 ExecutionFrameBase& frame, Value& result) {
204 // Select steps can be applied to either maps or messages
205 switch (container.kind()) {
206 case ValueKind::kMap: {
207 LookupInMap(Cast<MapValue>(container), key, frame, result);
208 return;
209 }
210 case ValueKind::kList: {
211 LookupInList(Cast<ListValue>(container), key, frame, result);
212 return;
213 }
214 default:
215 result = cel::ErrorValue(absl::InvalidArgumentError(
216 absl::StrCat("Invalid container type: '",
217 ValueKindToString(container->kind()), "'")));
218 return;
219 }
220}
221
222void PerformLookup(ExecutionFrameBase& frame, const Value& container,
223 const Value& key, const AttributeTrail& container_trail,

Callers 1

PerformLookupFunction · 0.85

Calls 5

LookupInMapFunction · 0.85
LookupInListFunction · 0.85
ErrorValueFunction · 0.85
ValueKindToStringFunction · 0.85
kindMethod · 0.45

Tested by

no test coverage detected