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

Method CopyToArray

common/internal/byte_string.cc:468–485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

466}
467
468void ByteString::CopyToArray(char* absl_nonnull out) const {
469 ABSL_DCHECK(out != nullptr);
470
471 switch (GetKind()) {
472 case ByteStringKind::kSmall: {
473 absl::string_view small = GetSmall();
474 std::memcpy(out, small.data(), small.size());
475 } break;
476 case ByteStringKind::kMedium: {
477 absl::string_view medium = GetMedium();
478 std::memcpy(out, medium.data(), medium.size());
479 } break;
480 case ByteStringKind::kLarge: {
481 const absl::Cord& large = GetLarge();
482 (CopyCordToArray)(large, out);
483 } break;
484 }
485}
486
487std::string ByteString::ToString() const {
488 switch (GetKind()) {

Callers 1

ConcatMethod · 0.80

Calls 4

GetKindFunction · 0.85
GetSmallFunction · 0.85
GetMediumFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected