MCPcopy Create free account
hub / github.com/4paradigm/OpenMLDB / SetString

Method SetString

src/codec/codec.cc:331–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331bool RowBuilder::SetString(uint32_t index, const char* val, uint32_t length) {
332 if (val == NULL || (!Check(index, ::fedb::type::kVarchar) &&
333 !Check(index, fedb::type::kString))) {
334 return false;
335 }
336 if (str_offset_ + length > size_) return false;
337 uint32_t str_pos = offset_vec_[index];
338 if (str_pos == 0) {
339 SetStrOffset(str_pos);
340 }
341 if (length != 0) {
342 memcpy(reinterpret_cast<char*>(buf_ + str_offset_), val, length);
343 }
344 str_offset_ += length;
345 SetStrOffset(str_pos + 1);
346 SetField(index);
347 return true;
348}
349
350bool RowBuilder::AppendValue(const std::string& val) {
351 bool ok = false;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected