| 144 | } |
| 145 | |
| 146 | Bytes getFile(const Path& path) override |
| 147 | { |
| 148 | AdfMount m(this); |
| 149 | if (path.size() == 0) |
| 150 | throw BadPathException(); |
| 151 | |
| 152 | auto* vol = m.mount(); |
| 153 | changeDirButOne(vol, path); |
| 154 | |
| 155 | auto* file = adfOpenFile(vol, (char*)path.back().c_str(), (char*)"r"); |
| 156 | if (!file) |
| 157 | throw FileNotFoundException(); |
| 158 | |
| 159 | Bytes bytes; |
| 160 | ByteWriter bw(bytes); |
| 161 | while (!adfEndOfFile(file)) |
| 162 | { |
| 163 | uint8_t buffer[4096]; |
| 164 | long done = adfReadFile(file, sizeof(buffer), buffer); |
| 165 | |
| 166 | bw += Bytes(buffer, done); |
| 167 | } |
| 168 | |
| 169 | adfCloseFile(file); |
| 170 | return bytes; |
| 171 | } |
| 172 | |
| 173 | void putFile(const Path& path, const Bytes& data) override |
| 174 | { |
nothing calls this directly
no test coverage detected