MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / addString

Method addString

src/common/vector/value_vector.cpp:485–496  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

483}
484
485void StringVector::addString(ValueVector* vector, uint32_t vectorPos, string_t& srcStr) {
486 DASSERT(vector->dataType.getPhysicalType() == PhysicalTypeID::STRING ||
487 vector->dataType.getPhysicalType() == PhysicalTypeID::JSON);
488 auto stringBuffer = dynamic_cast_checked<StringAuxiliaryBuffer*>(vector->auxiliaryBuffer.get());
489 auto& dstStr = vector->getValue<string_t>(vectorPos);
490 if (string_t::isShortString(srcStr.len)) {
491 dstStr.setShortString(srcStr);
492 } else {
493 dstStr.overflowPtr = reinterpret_cast<uint64_t>(stringBuffer->allocateOverflow(srcStr.len));
494 dstStr.setLongString(srcStr);
495 }
496}
497
498void StringVector::addString(ValueVector* vector, uint32_t vectorPos, const char* srcStr,
499 uint64_t length) {

Callers

nothing calls this directly

Calls 7

isShortStringFunction · 0.85
getValue<string_t>Method · 0.80
allocateOverflowMethod · 0.80
lengthMethod · 0.80
getPhysicalTypeMethod · 0.45
getMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected