VirtualC64 v5.0 beta
Commodore 64 Emulator
Loading...
Searching...
No Matches
P00File.h
1// -----------------------------------------------------------------------------
2// This file is part of VirtualC64
3//
4// Copyright (C) Dirk W. Hoffmann. www.dirkwhoffmann.de
5// This FILE is dual-licensed. You are free to choose between:
6//
7// - The GNU General Public License v3 (or any later version)
8// - The Mozilla Public License v2
9//
10// SPDX-License-Identifier: GPL-3.0-or-later OR MPL-2.0
11// -----------------------------------------------------------------------------
12
13#pragma once
14
15#include "AnyCollection.h"
16
17namespace vc64 {
18
19class P00File : public AnyCollection {
20
21public:
22
23 static bool isCompatible(const fs::path &path);
24 static bool isCompatible(std::istream &stream);
25
26
27 //
28 // Initializing
29 //
30
31 P00File() : AnyCollection() { }
32 P00File(isize capacity) : AnyCollection(capacity) { }
33 P00File(const fs::path &path) throws { init(path); }
34 P00File(const u8 *buf, isize len) throws { init(buf, len); }
35 P00File(class FileSystem &fs) throws { init(fs); }
36
37private:
38
39 using AnyFile::init;
40 void init(FileSystem &fs) throws;
41
42
43 //
44 // Methods from CoreObject
45 //
46
47 const char *objectName() const override { return "P00File"; }
48
49
50 //
51 // Methods from AnyFile
52 //
53
54 bool isCompatiblePath(const fs::path &path) override { return isCompatible(path); }
55 bool isCompatibleStream(std::istream &stream) override { return isCompatible(stream); }
56 FileType type() const override { return FILETYPE_P00; }
57 PETName<16> getName() const override;
58
59
60 //
61 // Methods from AnyCollection
62 //
63
64 PETName<16> collectionName() override;
65 isize collectionCount() const override;
66 PETName<16> itemName(isize nr) const override;
67 isize itemSize(isize nr) const override;
68 u8 readByte(isize nr, isize pos) const override;
69};
70
71}
VirtualC64 project namespace.
Definition CmdQueue.cpp:16