| 329 | } |
| 330 | |
| 331 | bool 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 | |
| 350 | bool RowBuilder::AppendValue(const std::string& val) { |
| 351 | bool ok = false; |
nothing calls this directly
no outgoing calls
no test coverage detected