MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / appendString

Method appendString

pj_datastore/src/column_buffer.cpp:129–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129void TypedColumnBuffer::appendString(std::string_view value) {
130 assert(storageKindOf(descriptor_.logical_type) == StorageKind::kString);
131 // Write the initial offset (0) on first row.
132 if (row_count_ == 0) {
133 const uint32_t zero = 0;
134 offsets_.append(&zero, sizeof(zero));
135 }
136
137 // Append string bytes to value buffer.
138 values_.append(value.data(), value.size());
139
140 // Append new end offset.
141 const auto end_offset = static_cast<uint32_t>(values_.size());
142 offsets_.append(&end_offset, sizeof(end_offset));
143
144 // Update validity if initialized.
145 if (validity_initialized_) {
146 validity_.ensureSize(row_count_ + 1);
147 validity_.setValid(row_count_);
148 }
149
150 ++row_count_;
151}
152
153void TypedColumnBuffer::appendNull() {
154 ensureValidityInitialized();

Callers 4

string_view>Method · 0.80
sortRowsByTimestampMethod · 0.80
TESTFunction · 0.80

Calls 6

storageKindOfFunction · 0.85
ensureSizeMethod · 0.80
appendMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
setValidMethod · 0.45

Tested by 1

TESTFunction · 0.64