MCPcopy Create free account
hub / github.com/ElementsProject/elements / Read

Method Read

src/leveldb/util/env_windows.cc:156–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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;

Callers

nothing calls this directly

Calls 4

WindowsErrorFunction · 0.85
OKFunction · 0.85
SliceClass · 0.70
getMethod · 0.45

Tested by

no test coverage detected