ByteReader over the streamed body, positioned at the file part's start. TransferProto::extractZip owns the length accounting.
| 212 | // ByteReader over the streamed body, positioned at the file part's start. |
| 213 | // TransferProto::extractZip owns the length accounting. |
| 214 | struct BodyReader : TransferProto::ByteReader { |
| 215 | FSStream input; |
| 216 | explicit BodyReader(const std::u16string& path, u64 startOffset) : input(Archive::sdmc(), path, FS_OPEN_READ) |
| 217 | { |
| 218 | if (input.good()) { |
| 219 | input.offset((u32)startOffset); |
| 220 | } |
| 221 | } |
| 222 | bool good() { return input.good(); } |
| 223 | ~BodyReader() override |
| 224 | { |
| 225 | if (input.good()) { |
| 226 | input.close(); |
| 227 | } |
| 228 | } |
| 229 | size_t read(void* dst, size_t n) override { return input.good() ? input.read(dst, (u32)n) : 0; } |
| 230 | }; |
| 231 | |
| 232 | // ExtractSink writing under a u16string destination root via FSStream. |
| 233 | struct FsExtractSink : TransferProto::ExtractSink { |
nothing calls this directly
no outgoing calls
no test coverage detected