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

Method SetStrOffset

src/codec/codec.cc:209–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207}
208
209void RowBuilder::SetStrOffset(uint32_t str_pos) {
210 if (str_pos >= str_field_cnt_) {
211 return;
212 }
213 int8_t* ptr = buf_ + str_field_start_offset_ + str_addr_length_ * str_pos;
214 if (str_addr_length_ == 1) {
215 *(reinterpret_cast<uint8_t*>(ptr)) = (uint8_t)str_offset_;
216 } else if (str_addr_length_ == 2) {
217 *(reinterpret_cast<uint16_t*>(ptr)) = (uint16_t)str_offset_;
218 } else if (str_addr_length_ == 3) {
219 *(reinterpret_cast<uint8_t*>(ptr)) = str_offset_ >> 16;
220 *(reinterpret_cast<uint8_t*>(ptr + 1)) = (str_offset_ & 0xFF00) >> 8;
221 *(reinterpret_cast<uint8_t*>(ptr + 2)) = str_offset_ & 0x00FF;
222 } else {
223 *(reinterpret_cast<uint32_t*>(ptr)) = str_offset_;
224 }
225}
226
227bool RowBuilder::AppendBool(bool val) {
228 if (!SetBool(cnt_, val)) return false;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected