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

Method ValueDebugString

internal/json.cc:1654–1688  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1652 : accessor_(accessor), output_(output) {}
1653
1654 void ValueDebugString(const google::protobuf::MessageLite& message) {
1655 const auto kind_case = accessor_->GetKindCase(message);
1656 switch (kind_case) {
1657 case google::protobuf::Value::KIND_NOT_SET:
1658 ABSL_FALLTHROUGH_INTENDED;
1659 case google::protobuf::Value::kNullValue:
1660 output_->append("null");
1661 break;
1662 case google::protobuf::Value::kBoolValue:
1663 if (accessor_->GetBoolValue(message)) {
1664 output_->append("true");
1665 } else {
1666 output_->append("false");
1667 }
1668 break;
1669 case google::protobuf::Value::kNumberValue:
1670 output_->append(
1671 JsonNumberDebugString(accessor_->GetNumberValue(message)));
1672 break;
1673 case google::protobuf::Value::kStringValue:
1674 output_->append(JsonStringDebugString(
1675 accessor_->GetStringValue(message, scratch_)));
1676 break;
1677 case google::protobuf::Value::kListValue:
1678 ListValueDebugString(accessor_->GetListValue(message));
1679 break;
1680 case google::protobuf::Value::kStructValue:
1681 StructDebugString(accessor_->GetStructValue(message));
1682 break;
1683 default:
1684 // Should not get here, but if for some terrible reason
1685 // `google.protobuf.Value` is expanded, just skip.
1686 break;
1687 }
1688 }
1689
1690 void ListValueDebugString(const google::protobuf::MessageLite& message) {
1691 const int size = accessor_->ValuesSize(message);

Callers 1

JsonDebugStringFunction · 0.80

Calls 6

JsonNumberDebugStringFunction · 0.85
JsonStringDebugStringFunction · 0.85
GetKindCaseMethod · 0.45
GetBoolValueMethod · 0.45
GetNumberValueMethod · 0.45
GetStringValueMethod · 0.45

Tested by

no test coverage detected