2020-11-24 02:42:18 +00:00
|
|
|
//
|
|
|
|
// 2MG.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 23/11/2020.
|
|
|
|
// Copyright © 2020 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
2024-01-17 04:34:46 +00:00
|
|
|
#pragma once
|
2020-11-24 02:42:18 +00:00
|
|
|
|
|
|
|
#include "../DiskImage.hpp"
|
2022-08-26 20:38:10 +00:00
|
|
|
#include "../../../MassStorage/MassStorageDevice.hpp"
|
|
|
|
|
2020-11-24 02:42:18 +00:00
|
|
|
#include "../../../FileHolder.hpp"
|
|
|
|
|
2024-01-17 22:26:20 +00:00
|
|
|
#include <cstddef>
|
2022-08-26 20:38:10 +00:00
|
|
|
#include <variant>
|
|
|
|
|
2023-05-10 21:02:18 +00:00
|
|
|
namespace Storage::Disk {
|
2020-11-24 02:42:18 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
2MG is slightly special because it's just a container format; there's a brief header and then
|
|
|
|
the contents are some other file format — either MacintoshIMG or AppleDSK.
|
|
|
|
|
|
|
|
Therefore it supplies a factory method and will actually return one of those.
|
|
|
|
|
|
|
|
TODO: should I generalise on factory methods? Is this likely to occur again?
|
|
|
|
*/
|
|
|
|
|
|
|
|
class Disk2MG {
|
2024-12-02 02:44:14 +00:00
|
|
|
public:
|
|
|
|
using DiskOrMassStorageDevice =
|
|
|
|
std::variant<std::nullptr_t, DiskImageHolderBase *, Storage::MassStorage::MassStorageDevice *>;
|
|
|
|
static DiskOrMassStorageDevice open(const std::string &file_name);
|
2020-11-24 02:42:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|