The writer now works with the new config system.

This commit is contained in:
David Given
2021-05-13 15:55:05 +02:00
parent c2aae7ee18
commit 3a8ddf8025
31 changed files with 363 additions and 305 deletions

View File

@@ -4,6 +4,7 @@
#include "sector.h"
#include "sectorset.h"
#include "imagereader/imagereader.h"
#include "lib/config.pb.h"
#include "fmt/format.h"
#include <algorithm>
#include <iostream>
@@ -12,13 +13,13 @@
class DiskCopyImageReader : public ImageReader
{
public:
DiskCopyImageReader(const ImageSpec& spec):
ImageReader(spec)
DiskCopyImageReader(const Config_InputFile& config):
ImageReader(config)
{}
SectorSet readImage()
{
std::ifstream inputFile(spec.filename, std::ios::in | std::ios::binary);
std::ifstream inputFile(_config.filename(), std::ios::in | std::ios::binary);
if (!inputFile.is_open())
Error() << "cannot open input file";
@@ -120,9 +121,9 @@ public:
};
std::unique_ptr<ImageReader> ImageReader::createDiskCopyImageReader(
const ImageSpec& spec)
const Config_InputFile& config)
{
return std::unique_ptr<ImageReader>(new DiskCopyImageReader(spec));
return std::unique_ptr<ImageReader>(new DiskCopyImageReader(config));
}