1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-16 22:28:57 +00:00
CLK/Storage/Disk/DiskImage/Formats/CPCDSK.hpp
Thomas Harte 44cdc124af Switches to providing a full record of changes to disk images, rather than feeding them a track at a time.
Gets explicit about `override`s while doing so, to ensure full adaptation.
2017-10-07 19:37:36 -04:00

60 lines
1.3 KiB
C++

//
// CPCDSK.hpp
// Clock Signal
//
// Created by Thomas Harte on 05/08/2017.
// Copyright © 2017 Thomas Harte. All rights reserved.
//
#ifndef CPCDSK_hpp
#define CPCDSK_hpp
#include "../DiskImage.hpp"
#include "../../../FileHolder.hpp"
#include <vector>
namespace Storage {
namespace Disk {
/*!
Provies a @c Disk containing an Amstrad CPC-stype disk image — some arrangement of sectors with status bits.
*/
class CPCDSK: public DiskImage, public Storage::FileHolder {
public:
/*!
Construct an @c AcornADF containing content from the file with name @c file_name.
@throws ErrorCantOpen if this file can't be opened.
@throws ErrorNotAcornADF if the file doesn't appear to contain an Acorn .ADF format image.
*/
CPCDSK(const char *file_name);
enum {
ErrorNotCPCDSK,
};
// implemented to satisfy @c Disk
int get_head_position_count() override;
int get_head_count() override;
using DiskImage::get_is_read_only;
std::shared_ptr<Track> get_track_at_position(Track::Address address) override;
private:
int head_count_;
int head_position_count_;
bool is_extended_;
// Used only for non-extended disks.
long size_of_a_track_;
// Used only for extended disks.
std::vector<size_t> track_sizes_;
};
}
}
#endif /* CPCDSK_hpp */