MCPcopy Create free account
hub / github.com/bytedance/bolt / printNonNull

Method printNonNull

bolt/vector/VectorPrinter.cpp:135–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133
134 protected:
135 std::string printNonNull(vector_size_t index, const std::string& indent)
136 const override {
137 std::stringstream out;
138
139 auto arrayVector = decoded_.base()->as<ArrayVector>();
140 auto arrayIndex = decoded_.index(index);
141
142 const auto& elements = children_[0];
143
144 auto offset = arrayVector->offsetAt(arrayIndex);
145 auto size = arrayVector->sizeAt(arrayIndex);
146
147 auto newIndent = addIndent(indent);
148 bool fixedWidthElement = arrayVector->type()->childAt(0)->isFixedWidth();
149
150 for (auto i = 0; i < size; ++i) {
151 if (fixedWidthElement) {
152 out << indent << "Element " << i << ": "
153 << printFixedWidth(elements->decoded(), offset + i) << std::endl;
154 } else {
155 out << indent << "Element " << i << ": "
156 << elements->summarize(offset + i) << std::endl;
157 out << elements->print(offset + i, newIndent);
158 }
159 }
160
161 return out.str();
162 }
163
164 std::string summarizeNonNull(vector_size_t index) const override {
165 auto* base = decoded_.base();

Callers

nothing calls this directly

Calls 12

addIndentFunction · 0.85
printFixedWidthFunction · 0.85
offsetAtMethod · 0.80
sizeAtMethod · 0.80
isFixedWidthMethod · 0.80
childAtMethod · 0.80
summarizeMethod · 0.80
strMethod · 0.80
baseMethod · 0.45
indexMethod · 0.45
typeMethod · 0.45
printMethod · 0.45

Tested by

no test coverage detected