ScummVM API documentation
chroot-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 BACKENDS_FS_CHROOT_CHROOT_FS_H
23 #define BACKENDS_FS_CHROOT_CHROOT_FS_H
24 
25 #include "backends/fs/posix/posix-fs.h"
26 
27 class ChRootFilesystemNode final : public AbstractFSNode {
28  Common::String _root;
29  Common::String _drive;
30  POSIXFilesystemNode *_realNode;
31 
33 
34 public:
35  ChRootFilesystemNode(const Common::String &root, const Common::String &path, const Common::String &drive = Common::String());
36  ~ChRootFilesystemNode() override;
37 
38  bool exists() const override;
39  Common::U32String getDisplayName() const override;
40  Common::String getName() const override;
41  Common::String getPath() const override;
42  bool isDirectory() const override;
43  bool isReadable() const override;
44  bool isWritable() const override;
45 
46  AbstractFSNode *getChild(const Common::String &n) const override;
47  bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const override;
48  AbstractFSNode *getParent() const override;
49 
51  Common::SeekableWriteStream *createWriteStream(bool atomic) override;
52  bool createDirectory() override;
53 
54 private:
55  static Common::String addPathComponent(const Common::String &path, const Common::String &component);
56 };
57 
58 #endif /* BACKENDS_FS_CHROOT_CHROOT_FS_H */
Definition: str.h:59
AbstractFSNode * getChild(const Common::String &n) const override
Definition: array.h:52
AbstractFSNode * getParent() const override
bool isDirectory() const override
bool isWritable() const override
Definition: stream.h:745
Common::String getName() const override
Common::U32String getDisplayName() const override
Common::String getPath() const override
Common::SeekableReadStream * createReadStream() override
Definition: ustr.h:57
ListMode
Definition: fs.h:86
bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const override
Definition: chroot-fs.h:27
bool createDirectory() override
bool isReadable() const override
Definition: stream.h:351
Common::SeekableWriteStream * createWriteStream(bool atomic) override
Definition: abstract-fs.h:41
Definition: posix-fs.h:32