| 232 | } |
| 233 | |
| 234 | std::unique_ptr<Filesystem> Filesystem::createFilesystemFromConfig() |
| 235 | { |
| 236 | std::shared_ptr<SectorInterface> sectorInterface; |
| 237 | auto diskLayout = createDiskLayout(globalConfig()); |
| 238 | if (globalConfig().hasFluxSource() || globalConfig().hasFluxSink()) |
| 239 | { |
| 240 | std::shared_ptr<FluxSource> fluxSource; |
| 241 | std::shared_ptr<Decoder> decoder; |
| 242 | std::shared_ptr<FluxSinkFactory> fluxSinkFactory; |
| 243 | std::shared_ptr<Encoder> encoder; |
| 244 | if (globalConfig().hasFluxSource()) |
| 245 | { |
| 246 | fluxSource = FluxSource::create(globalConfig()); |
| 247 | decoder = Arch::createDecoder(globalConfig()); |
| 248 | } |
| 249 | if (globalConfig()->flux_sink().type() == FLUXTYPE_DRIVE) |
| 250 | { |
| 251 | fluxSinkFactory = FluxSinkFactory::create(globalConfig()); |
| 252 | encoder = Arch::createEncoder(globalConfig()); |
| 253 | } |
| 254 | sectorInterface = SectorInterface::createFluxSectorInterface( |
| 255 | diskLayout, fluxSource, fluxSinkFactory, encoder, decoder); |
| 256 | } |
| 257 | else |
| 258 | { |
| 259 | std::shared_ptr<ImageReader> reader; |
| 260 | std::shared_ptr<ImageWriter> writer; |
| 261 | if (globalConfig().hasImageReader() && |
| 262 | doesFileExist(globalConfig()->image_reader().filename())) |
| 263 | reader = ImageReader::create(globalConfig()); |
| 264 | if (globalConfig().hasImageWriter()) |
| 265 | writer = ImageWriter::create(globalConfig()); |
| 266 | |
| 267 | sectorInterface = SectorInterface::createImageSectorInterface( |
| 268 | diskLayout, reader, writer); |
| 269 | } |
| 270 | |
| 271 | return createFilesystem( |
| 272 | globalConfig()->filesystem(), diskLayout, sectorInterface); |
| 273 | } |
| 274 | |
| 275 | Bytes Filesystem::getSector(unsigned track, unsigned side, unsigned sector) |
| 276 | { |
nothing calls this directly
no test coverage detected