Get slice of Refs[Offset : Offset + Length - 1]
| 94 | |
| 95 | /// Get slice of Refs[Offset : Offset + Length - 1] |
| 96 | Expect<Span<const RefVariant>> getRefs(const uint64_t Offset, |
| 97 | const uint64_t Length) const noexcept { |
| 98 | // Check the accessing boundary. |
| 99 | if (!checkAccessBound(Offset, Length)) { |
| 100 | spdlog::error(ErrCode::Value::TableOutOfBounds); |
| 101 | spdlog::error(ErrInfo::InfoBoundary(Offset, Length, getSize())); |
| 102 | return Unexpect(ErrCode::Value::TableOutOfBounds); |
| 103 | } |
| 104 | return Span<const RefVariant>( |
| 105 | Refs.begin() + static_cast<std::ptrdiff_t>(Offset), Length); |
| 106 | } |
| 107 | |
| 108 | /// Replace the Refs[Dst :] by Slice[Src : Src + Length) |
| 109 | Expect<void> setRefs(Span<const RefVariant> Slice, const uint64_t Dst, |
no test coverage detected