| 69 | } |
| 70 | |
| 71 | static Error outOfBOundsLoad(const std::string& pathStr, size_t byteOffset, size_t toReadSize, size_t fileSize) { |
| 72 | return Error(STRING_FORMAT("Out of bounds read {} (asked byte offest {} with size {}, file size is {})", |
| 73 | pathStr, |
| 74 | byteOffset, |
| 75 | toReadSize, |
| 76 | fileSize)); |
| 77 | } |
| 78 | |
| 79 | Result<BytesView> FileReader::read(size_t byteOffset, std::optional<size_t> size) { |
| 80 | size_t toReadSize = size.has_value() ? size.value() : _fileSize; |