mirror of
https://github.com/TomHarte/CLK.git
synced 2026-03-11 04:42:20 +00:00
43 lines
1.1 KiB
C++
43 lines
1.1 KiB
C++
//
|
|
// NIB.hpp
|
|
// Clock Signal
|
|
//
|
|
// Created by Thomas Harte on 21/04/2018.
|
|
// Copyright 2018 Thomas Harte. All rights reserved.
|
|
//
|
|
|
|
#pragma once
|
|
|
|
#include "Storage/Disk/DiskImage/DiskImage.hpp"
|
|
#include "Storage/Disk/Track/PCMTrack.hpp"
|
|
#include "Storage/FileHolder.hpp"
|
|
|
|
#include <memory>
|
|
|
|
namespace Storage::Disk {
|
|
|
|
/*!
|
|
Provides a @c DiskImage describing an Apple NIB disk image:
|
|
a bit stream capture that omits sync zeroes, and doesn't define
|
|
the means for full reconstruction.
|
|
*/
|
|
class NIB: public DiskImage {
|
|
public:
|
|
NIB(const std::string &file_name);
|
|
|
|
// Implemented to satisfy @c DiskImage.
|
|
HeadPosition maximum_head_position() const;
|
|
Track::Address canonical_address(Track::Address) const;
|
|
std::unique_ptr<Track> track_at_position(Track::Address) const;
|
|
void set_tracks(const std::map<Track::Address, std::unique_ptr<Track>> &tracks);
|
|
bool is_read_only() const;
|
|
bool represents(const std::string &) const;
|
|
|
|
private:
|
|
mutable FileHolder file_;
|
|
long get_file_offset_for_position(Track::Address address) const;
|
|
long file_offset(Track::Address address) const;
|
|
};
|
|
|
|
}
|