| 171 | } |
| 172 | |
| 173 | void putFile(const Path& path, const Bytes& data) override |
| 174 | { |
| 175 | AdfMount m(this); |
| 176 | if (path.size() == 0) |
| 177 | throw BadPathException(); |
| 178 | |
| 179 | auto* vol = m.mount(); |
| 180 | changeDirButOne(vol, path); |
| 181 | |
| 182 | auto* file = adfOpenFile(vol, (char*)path.back().c_str(), (char*)"w"); |
| 183 | if (!file) |
| 184 | throw CannotWriteException(); |
| 185 | |
| 186 | unsigned pos = 0; |
| 187 | while (pos != data.size()) |
| 188 | { |
| 189 | long done = adfWriteFile( |
| 190 | file, data.size() - pos, (uint8_t*)data.cbegin() + pos); |
| 191 | pos += done; |
| 192 | } |
| 193 | |
| 194 | adfCloseFile(file); |
| 195 | } |
| 196 | |
| 197 | void deleteFile(const Path& path) override |
| 198 | { |
nothing calls this directly
no test coverage detected