MCPcopy Create free account
hub / github.com/apache/arrow / PrintTruncatedMetadata

Method PrintTruncatedMetadata

cpp/src/arrow/pretty_print.cc:593–607  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

591 }
592
593 void PrintTruncatedMetadata(const KeyValueMetadata& metadata) {
594 for (int64_t i = 0; i < metadata.size(); ++i) {
595 Newline();
596 Indent();
597 size_t size = metadata.value(i).size();
598 size_t truncated_size = std::max<size_t>(10, 70 - metadata.key(i).size() - indent_);
599 if (size <= truncated_size) {
600 Write(metadata.key(i) + ": '" + metadata.value(i) + "'");
601 continue;
602 }
603
604 Write(metadata.key(i) + ": '" + metadata.value(i).substr(0, truncated_size) +
605 "' + " + ToChars(size - truncated_size));
606 }
607 }
608
609 void PrintMetadata(const std::string& metadata_type, const KeyValueMetadata& metadata) {
610 if (metadata.size() > 0) {

Callers

nothing calls this directly

Calls 6

WriteFunction · 0.85
ToCharsFunction · 0.85
substrMethod · 0.80
sizeMethod · 0.45
valueMethod · 0.45
keyMethod · 0.45

Tested by

no test coverage detected