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

Function FormatBytesLiteral

internal/strings.cc:672–676  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

670}
671
672std::string FormatBytesLiteral(absl::string_view str) {
673 absl::string_view quote =
674 (str.find('"') != str.npos && str.find('\'') == str.npos) ? "'" : "\"";
675 return absl::StrCat("b", quote, EscapeBytes(str, false, quote[0]), quote);
676}
677
678std::string FormatSingleQuotedBytesLiteral(absl::string_view str) {
679 return absl::StrCat("b'", EscapeBytes(str, false, '\''), "'");

Callers 5

TestBytesLiteralFunction · 0.85
TestUnescapedBytesFunction · 0.85
TESTFunction · 0.85
FormatBytesConstantFunction · 0.85
BytesDebugStringFunction · 0.85

Calls 1

EscapeBytesFunction · 0.85

Tested by 3

TestBytesLiteralFunction · 0.68
TestUnescapedBytesFunction · 0.68
TESTFunction · 0.68