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