| 763 | } |
| 764 | |
| 765 | int32_t RowView::GetString(uint32_t idx, char** val, uint32_t* length) { |
| 766 | if (val == NULL || length == NULL) { |
| 767 | return -1; |
| 768 | } |
| 769 | |
| 770 | if (!CheckValid(idx, ::fedb::type::kVarchar) && |
| 771 | !CheckValid(idx, fedb::type::kString)) { |
| 772 | return -1; |
| 773 | } |
| 774 | if (IsNULL(row_, idx)) { |
| 775 | return 1; |
| 776 | } |
| 777 | uint32_t field_offset = offset_vec_.at(idx); |
| 778 | uint32_t next_str_field_offset = 0; |
| 779 | if (offset_vec_.at(idx) < string_field_cnt_ - 1) { |
| 780 | next_str_field_offset = field_offset + 1; |
| 781 | } |
| 782 | return v1::GetStrField(row_, field_offset, next_str_field_offset, |
| 783 | str_field_start_offset_, str_addr_length_, |
| 784 | reinterpret_cast<int8_t**>(val), length); |
| 785 | } |
| 786 | |
| 787 | int32_t RowView::GetStrValue(uint32_t idx, std::string* val) { |
| 788 | return GetStrValue(row_, idx, val); |