MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / FsFileReader

Class FsFileReader

3ds/source/transfer.cpp:263–278  ·  view source on GitHub ↗

FileReader opening backup files (UTF-8 abs path) via FSStream for the send.

Source from the content-addressed store, hash-verified

261
262 // FileReader opening backup files (UTF-8 abs path) via FSStream for the send.
263 struct FsFileReader : TransferProto::FileReader {
264 std::optional<FSStream> stream;
265 bool open(const std::string& absPath) override
266 {
267 stream.emplace(Archive::sdmc(), StringUtils::UTF8toUTF16(absPath.c_str()), FS_OPEN_READ);
268 return stream->good();
269 }
270 size_t read(void* dst, size_t n) override { return stream ? stream->read(dst, (u32)n) : 0; }
271 void close() override
272 {
273 if (stream) {
274 stream->close();
275 stream.reset();
276 }
277 }
278 };
279
280 Server::HttpResponse handleInfo(const std::string&, const std::string&)
281 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected