openMSX
DiskPartition.hh
Go to the documentation of this file.
1 #ifndef DISKPARTITION_HH
2 #define DISKPARTITION_HH
3 
4 #include "SectorBasedDisk.hh"
5 #include <memory>
6 
7 namespace openmsx {
8 
9 class DiskPartition final : public SectorBasedDisk
10 {
11 public:
22  std::shared_ptr<SectorAccessibleDisk> owned = nullptr);
23 
25  size_t start, size_t length);
26 
27 private:
28  void readSectorImpl (size_t sector, SectorBuffer& buf) override;
29  void writeSectorImpl(size_t sector, const SectorBuffer& buf) override;
30  bool isWriteProtectedImpl() const override;
31 
32  SectorAccessibleDisk& parent;
33  std::shared_ptr<SectorAccessibleDisk> owned;
34  size_t start;
35 };
36 
37 } // namespace openmsx
38 
39 #endif
T length(const vecN< N, T > &x)
Definition: gl_vec.hh:334
Abstract class for disk images that only represent the logical sector information (so not the raw tra...
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
void partition(SectorAccessibleDisk &disk, const std::vector< unsigned > &sizes)
Write a partition table to the given disk and format each partition.
DiskPartition(SectorAccessibleDisk &disk, unsigned partition, std::shared_ptr< SectorAccessibleDisk > owned=nullptr)
Return a partition (as a SectorbasedDisk) from another Disk.