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

Function FormatStringLiteral

internal/strings.cc:651–655  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

649}
650
651std::string FormatStringLiteral(absl::string_view str) {
652 absl::string_view quote =
653 (str.find('"') != str.npos && str.find('\'') == str.npos) ? "'" : "\"";
654 return absl::StrCat(quote, EscapeInternal(str, true, quote[0]), quote);
655}
656
657std::string FormatStringLiteral(const absl::Cord& str) {
658 if (auto flat = str.TryFlat(); flat) {

Callers 5

TestStringFunction · 0.85
TESTFunction · 0.85
JsonStringDebugStringFunction · 0.85
FormatStringConstantFunction · 0.85
StringDebugStringFunction · 0.85

Calls 2

EscapeInternalFunction · 0.85
TryFlatMethod · 0.80

Tested by 2

TestStringFunction · 0.68
TESTFunction · 0.68