1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-01 11:49:58 +00:00
CLK/Storage/Disk/DiskImage/Formats/2MG.hpp
Ryan Carsten Schmidt 070efd99e0 Include <cstddef> and use std::nullptr_t not nullptr_t
Fixes "error: use of undeclared identifier 'nullptr_t'; did you mean
'nullptr'?" when compiling with Xcode 12.4.
2024-01-20 19:17:18 -06:00

37 lines
908 B
C++

//
// 2MG.hpp
// Clock Signal
//
// Created by Thomas Harte on 23/11/2020.
// Copyright © 2020 Thomas Harte. All rights reserved.
//
#pragma once
#include "../DiskImage.hpp"
#include "../../../MassStorage/MassStorageDevice.hpp"
#include "../../../FileHolder.hpp"
#include <cstddef>
#include <variant>
namespace Storage::Disk {
/*!
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 {
public:
using DiskOrMassStorageDevice = std::variant<std::nullptr_t, DiskImageHolderBase *, Storage::MassStorage::MassStorageDevice *>;
static DiskOrMassStorageDevice open(const std::string &file_name);
};
}