1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-13 00:29:14 +00:00
CLK/Storage/MassStorage/Encodings/MacintoshVolume.hpp

56 lines
1.4 KiB
C++
Raw Normal View History

//
// MacintoshVolume.hpp
// Clock Signal
//
// Created by Thomas Harte on 25/08/2019.
// Copyright © 2019 Thomas Harte. All rights reserved.
//
#pragma once
2022-03-25 20:58:06 +00:00
#include <cstddef>
#include <cstdint>
2019-09-19 02:04:54 +00:00
#include <sys/types.h>
#include "ApplePartitionMap.hpp"
2023-05-10 21:02:18 +00:00
namespace Storage::MassStorage::Encodings::Macintosh {
using DriveType = Storage::MassStorage::Encodings::Apple::DriveType;
/*!
On the Macintosh life is slightly complicated by Apple's
decision to include device drivers on mass storage drives
themselves therefore a mass-storage device that is
connected by SCSI will have different preliminary data on it
than the same volume connected by ATA or as an HD20.
Mass storage devices that respond to @c Volume can be made
to provide the proper whole-volume encoding necessary to
impersonate different types of Macintosh drive.
*/
class Volume {
public:
virtual void set_drive_type(DriveType type) = 0;
};
struct VolumeProvider {
static constexpr bool HasDriver = true;
size_t driver_size() const;
uint16_t driver_checksum() const;
const uint8_t *driver() const;
const char *driver_target() const;
const char *name() const;
const char *type() const;
};
/*!
A Mapper can used by a mass-storage device that knows the
2022-08-23 20:19:19 +00:00
contents of an HFS partition to provide the conversion
necessary to a particular type of drive.
*/
using Mapper = Storage::MassStorage::Encodings::Apple::PartitionMap<VolumeProvider>;
}