1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-30 04:50:08 +00:00
CLK/Storage/Disk/DiskImage/Formats/IMD.hpp
2023-12-08 15:37:13 -05:00

46 lines
1.1 KiB
C++

//
// IMD.hpp
// Clock Signal
//
// Created by Thomas Harte on 08/12/2023.
// Copyright © 2023 Thomas Harte. All rights reserved.
//
#ifndef IMD_hpp
#define IMD_hpp
#include "../DiskImage.hpp"
#include "../../../FileHolder.hpp"
namespace Storage::Disk {
/*!
Provides an @c DiskImage containing an IMD image, which is a collection of arbitrarily-numbered FM or MFM
sectors collected by track.
*/
class IMD: public DiskImage {
public:
/*!
Construct an @c IMD containing content from the file with name @c file_name.
@throws Storage::FileHolder::Error::CantOpen if this file can't be opened.
@throws Error::InvalidFormat if the file doesn't appear to contain an Acorn .ADF format image.
*/
IMD(const std::string &file_name);
// DiskImage interface.
HeadPosition get_maximum_head_position() final;
int get_head_count() final;
std::shared_ptr<::Storage::Disk::Track> get_track_at_position(::Storage::Disk::Track::Address address) final;
private:
FileHolder file_;
std::map<Storage::Disk::Track::Address, long> track_locations_;
uint8_t cylinders_ = 0, heads_ = 0;
};
}
#endif /* IMD_hpp */