| 154 | ~WindowsSequentialFile() override {} |
| 155 | |
| 156 | Status Read(size_t n, Slice* result, char* scratch) override { |
| 157 | DWORD bytes_read; |
| 158 | // DWORD is 32-bit, but size_t could technically be larger. However leveldb |
| 159 | // files are limited to leveldb::Options::max_file_size which is clamped to |
| 160 | // 1<<30 or 1 GiB. |
| 161 | assert(n <= std::numeric_limits<DWORD>::max()); |
| 162 | if (!::ReadFile(handle_.get(), scratch, static_cast<DWORD>(n), &bytes_read, |
| 163 | nullptr)) { |
| 164 | return WindowsError(filename_, ::GetLastError()); |
| 165 | } |
| 166 | |
| 167 | *result = Slice(scratch, bytes_read); |
| 168 | return Status::OK(); |
| 169 | } |
| 170 | |
| 171 | Status Skip(uint64_t n) override { |
| 172 | LARGE_INTEGER distance; |
nothing calls this directly
no test coverage detected