Returns the encoded representation of the row at index i. If i is kRowIdForNulls, it returns the pre-encoded all-nulls row.
| 373 | // If i is kRowIdForNulls, it returns the pre-encoded all-nulls |
| 374 | // row. |
| 375 | inline std::string encoded_row(int32_t i) const { |
| 376 | if (i == kRowIdForNulls()) { |
| 377 | return std::string(reinterpret_cast<const char*>(encoded_nulls_.data()), |
| 378 | encoded_nulls_.size()); |
| 379 | } |
| 380 | int32_t row_length = offsets_[i + 1] - offsets_[i]; |
| 381 | return std::string(reinterpret_cast<const char*>(bytes_.data() + offsets_[i]), |
| 382 | row_length); |
| 383 | } |
| 384 | |
| 385 | int32_t num_rows() const { |
| 386 | return offsets_.empty() ? 0 : static_cast<int32_t>(offsets_.size() - 1); |