| 51 | } // namespace cpp11 |
| 52 | |
| 53 | void arrow::r::validate_slice_offset(R_xlen_t offset, int64_t len) { |
| 54 | if (offset == NA_INTEGER) { |
| 55 | cpp11::stop("Slice 'offset' cannot be NA"); |
| 56 | } |
| 57 | if (offset < 0) { |
| 58 | cpp11::stop("Slice 'offset' cannot be negative"); |
| 59 | } |
| 60 | if (offset > len) { |
| 61 | cpp11::stop("Slice 'offset' greater than array length"); |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | void arrow::r::validate_slice_length(R_xlen_t length, int64_t available) { |
| 66 | if (length == NA_INTEGER) { |