2018-01-09 02:57:11 +00:00
|
|
|
//
|
|
|
|
// DMK.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 08/01/2018.
|
2018-05-13 19:19:52 +00:00
|
|
|
// Copyright 2018 Thomas Harte. All rights reserved.
|
2018-01-09 02:57:11 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef DMK_hpp
|
|
|
|
#define DMK_hpp
|
|
|
|
|
|
|
|
#include "../DiskImage.hpp"
|
|
|
|
#include "../../../FileHolder.hpp"
|
|
|
|
|
2018-04-06 21:42:24 +00:00
|
|
|
#include <string>
|
|
|
|
|
2023-05-10 21:02:18 +00:00
|
|
|
namespace Storage::Disk {
|
2018-01-09 02:57:11 +00:00
|
|
|
|
|
|
|
/*!
|
2018-05-13 19:34:31 +00:00
|
|
|
Provides a @c DiskImage containing a DMK disk image: mostly a decoded byte stream, but with
|
2018-01-09 02:57:11 +00:00
|
|
|
a record of IDAM locations.
|
|
|
|
*/
|
|
|
|
class DMK: public DiskImage {
|
|
|
|
public:
|
|
|
|
/*!
|
|
|
|
Construct a @c DMK containing content from the file with name @c file_name.
|
|
|
|
|
2018-04-28 03:18:45 +00:00
|
|
|
@throws Error::InvalidFormat if this file doesn't appear to be a DMK.
|
2018-01-09 02:57:11 +00:00
|
|
|
*/
|
2018-04-06 21:42:24 +00:00
|
|
|
DMK(const std::string &file_name);
|
2018-01-09 02:57:11 +00:00
|
|
|
|
|
|
|
// implemented to satisfy @c Disk
|
2020-01-24 03:57:51 +00:00
|
|
|
HeadPosition get_maximum_head_position() final;
|
|
|
|
int get_head_count() final;
|
|
|
|
bool get_is_read_only() final;
|
2018-01-09 02:57:11 +00:00
|
|
|
|
2020-01-24 03:57:51 +00:00
|
|
|
std::shared_ptr<::Storage::Disk::Track> get_track_at_position(::Storage::Disk::Track::Address address) final;
|
2018-01-09 02:57:11 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
FileHolder file_;
|
|
|
|
long get_file_offset_for_position(Track::Address address);
|
|
|
|
|
|
|
|
bool is_read_only_;
|
|
|
|
int head_position_count_;
|
|
|
|
int head_count_;
|
|
|
|
|
|
|
|
long track_length_;
|
|
|
|
bool is_purely_single_density_;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* DMK_hpp */
|