MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / getFile

Method getFile

lib/vfs/zdos.cc:237–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235 }
236
237 Bytes getFile(const Path& path) override
238 {
239 mount();
240 if (path.size() != 1)
241 throw BadPathException();
242
243 auto dirent = findFile(path.front());
244 dirent->zd.rewind();
245
246 Bytes bytes;
247 ByteWriter bw(bytes);
248 while (!dirent->zd.eof)
249 {
250 bw += dirent->zd.readRecord();
251 }
252
253 return bytes.slice(0, dirent->length);
254 }
255
256private:
257 void mount()

Callers

nothing calls this directly

Calls 5

BadPathExceptionClass · 0.85
readRecordMethod · 0.80
sliceMethod · 0.80
sizeMethod · 0.45
rewindMethod · 0.45

Tested by

no test coverage detected