VirtualC64 v5.0 beta
Commodore 64 Emulator
Loading...
Searching...
No Matches
PRGFile.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 PRGFile : public AnyCollection {
20
21public:
22
23 //
24 // Class methods
25 //
26
27 static bool isCompatible(const fs::path &path);
28 static bool isCompatible(std::istream &stream);
29
30
31 //
32 // Initializing
33 //
34
35 PRGFile() : AnyCollection() { }
36 PRGFile(isize capacity) : AnyCollection(capacity) { }
37 PRGFile(const fs::path &path) throws { init(path); }
38 PRGFile(const u8 *buf, isize len) throws { init(buf, len); }
39 PRGFile(class FileSystem &fs) throws { init(fs); }
40
41private:
42
43 using AnyFile::init;
44 void init(FileSystem &fs) throws;
45
46
47 //
48 // Methods from CoreObject
49 //
50
51 const char *objectName() const override { return "PRGFile"; }
52
53
54 //
55 // Methods from AnyFile
56 //
57
58 bool isCompatiblePath(const fs::path &path) override { return isCompatible(path); }
59 bool isCompatibleStream(std::istream &stream) override { return isCompatible(stream); }
60 FileType type() const override { return FILETYPE_PRG; }
61
62
63 //
64 // Methods from AnyCollection
65 //
66
67 PETName<16> collectionName() override;
68 isize collectionCount() const override;
69 PETName<16> itemName(isize nr) const override;
70 isize itemSize(isize nr) const override;
71 u8 readByte(isize nr, isize pos) const override;
72};
73
74}
VirtualC64 project namespace.
Definition CmdQueue.cpp:16