* Read the next 'len' bytes, and advance reader. * @param len Bytes to read, 'npos' to read all. * @return Up to 'len' bytes. */
| 528 | * @return Up to 'len' bytes. |
| 529 | */ |
| 530 | [[nodiscard]] std::string_view Read(size_type len) |
| 531 | { |
| 532 | auto result = this->Peek(len); |
| 533 | if (len != npos && len != result.size()) { |
| 534 | LogError(fmt::format("Source buffer too short: {} > {}", len, result.size())); |
| 535 | } |
| 536 | this->Skip(result.size()); |
| 537 | return result; |
| 538 | } |
| 539 | /** |
| 540 | * Discard some bytes. |
| 541 | * @param len Number of bytes to skip, 'npos' to skip all. |
no test coverage detected