ScummVM API documentation
kolibrios-fs.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef KOLIBRIOS_FS_H
23#define KOLIBRIOS_FS_H
24
25#include "backends/fs/abstract-fs.h"
26
33public:
40
41 bool exists() const override;
42 Common::U32String getDisplayName() const override { return _displayName; }
43 Common::String getName() const override { return _displayName; }
44 Common::String getPath() const override { return _path; }
45 static bool isDirectory(uint32 attrs) { return attrs & 0x18; }
46 bool isDirectory() const override { return isDirectory(_attributes); }
47 bool isReadable() const override;
48 bool isWritable() const override;
49
50 AbstractFSNode *getChild(const Common::String &n) const override;
51 bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const override;
52 AbstractFSNode *getParent() const override;
53
56 bool createDirectory() override;
57
58protected:
59 Common::String _displayName;
60 Common::String _path;
61 uint32 _attributes;
62 bool _isValid;
63
64 virtual AbstractFSNode *makeNode(const Common::String &path) const {
65 return new KolibriOSFilesystemNode(path);
66 }
67
71 KolibriOSFilesystemNode() : _attributes(0), _isValid(false) {}
72
76 virtual void setFlags();
77};
78
79namespace KolibriOS {
80
89bool assureDirectoryExists(const Common::String &dir, const char *prefix = nullptr);
90
91} // End of namespace KolibriOS
92
93#endif
Definition: abstract-fs.h:41
Definition: array.h:52
ListMode
Definition: fs.h:86
Definition: stream.h:745
Definition: stream.h:351
Definition: str.h:59
Definition: ustr.h:57
Definition: kolibrios-fs.h:32
bool isWritable() const override
AbstractFSNode * getChild(const Common::String &n) const override
KolibriOSFilesystemNode(const Common::String &path)
Common::SeekableReadStream * createReadStream() override
AbstractFSNode * getParent() const override
Common::String getPath() const override
Definition: kolibrios-fs.h:44
bool isReadable() const override
Common::SeekableWriteStream * createWriteStream(bool atomic) override
bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const override
bool createDirectory() override
KolibriOSFilesystemNode()
Definition: kolibrios-fs.h:71
virtual void setFlags()
Common::String getName() const override
Definition: kolibrios-fs.h:43
bool isDirectory() const override
Definition: kolibrios-fs.h:46
Common::U32String getDisplayName() const override
Definition: kolibrios-fs.h:42