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 
33 public:
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 
55  Common::SeekableWriteStream *createWriteStream(bool atomic) override;
56  bool createDirectory() override;
57 
58 protected:
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 
79 namespace KolibriOS {
80 
89 bool assureDirectoryExists(const Common::String &dir, const char *prefix = nullptr);
90 
91 } // End of namespace KolibriOS
92 
93 #endif
Common::String getPath() const override
Definition: kolibrios-fs.h:44
Definition: str.h:59
Common::SeekableReadStream * createReadStream() override
virtual void setFlags()
Definition: array.h:52
Definition: stream.h:745
KolibriOSFilesystemNode()
Definition: kolibrios-fs.h:71
bool createDirectory() override
Definition: ustr.h:57
bool isDirectory() const override
Definition: kolibrios-fs.h:46
ListMode
Definition: fs.h:86
Definition: kolibrios-fs.h:32
Common::U32String getDisplayName() const override
Definition: kolibrios-fs.h:42
bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const override
bool isWritable() const override
Definition: stream.h:351
bool isReadable() const override
Definition: kolibrios-fs.h:79
Common::SeekableWriteStream * createWriteStream(bool atomic) override
Definition: abstract-fs.h:41
Common::String getName() const override
Definition: kolibrios-fs.h:43
AbstractFSNode * getParent() const override
AbstractFSNode * getChild(const Common::String &n) const override