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

Function GetConstantKindCase

env/env_yaml.cc:403–421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

401}
402
403ConstantKindCase GetConstantKindCase(absl::string_view type_name) {
404 static const auto kTypeNameToConstantKindCase =
405 absl::NoDestructor<absl::flat_hash_map<std::string, ConstantKindCase>>({
406 {"null", ConstantKindCase::kNull},
407 {"bool", ConstantKindCase::kBool},
408 {"int", ConstantKindCase::kInt},
409 {"uint", ConstantKindCase::kUint},
410 {"double", ConstantKindCase::kDouble},
411 {"string", ConstantKindCase::kString},
412 {"bytes", ConstantKindCase::kBytes},
413 {"duration", ConstantKindCase::kDuration},
414 {"timestamp", ConstantKindCase::kTimestamp},
415 });
416 if (auto it = kTypeNameToConstantKindCase->find(type_name);
417 it != kTypeNameToConstantKindCase->end()) {
418 return it->second;
419 }
420 return ConstantKindCase::kUnspecified;
421}
422
423absl::StatusOr<Constant> ParseConstantValue(absl::string_view yaml,
424 const YAML::Node& node,

Callers 1

ParseVariableConfigsFunction · 0.85

Calls 1

endMethod · 0.45

Tested by

no test coverage detected