ScummVM API documentation
amigaos-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 AMIGAOS_FILESYSTEM_H
23 #define AMIGAOS_FILESYSTEM_H
24 
25 #ifdef __USE_INLINE__
26 #undef __USE_INLINE__
27 #endif
28 
29 #include <proto/exec.h>
30 #include <proto/dos.h>
31 #include <stdio.h>
32 
33 #ifndef USE_NEWLIB
34 #include <strings.h>
35 #endif
36 
37 #include "backends/fs/abstract-fs.h"
38 
44 class AmigaOSFilesystemNode final : public AbstractFSNode {
45 protected:
51  BPTR _pFileLock;
52 
53  Common::String _sDisplayName;
54  Common::String _sPath;
55  bool _bIsDirectory;
56  bool _bIsValid;
57  uint32 _nProt;
58 
62  virtual AbstractFSList listVolumes() const;
63 
67  bool isRootNode() const { return _bIsValid && _bIsDirectory && _pFileLock == 0; }
68 
69 public:
74 
81 
90  AmigaOSFilesystemNode(BPTR pLock, const char *pDisplayName = 0);
91 
98 
102  ~AmigaOSFilesystemNode() override;
103 
104  bool exists() const override;
105  Common::U32String getDisplayName() const override { return _sDisplayName; }
106  Common::String getName() const override { return _sDisplayName; }
107  Common::String getPath() const override { return _sPath; }
108  bool isDirectory() const override { return _bIsDirectory; }
109  bool isReadable() const override;
110  bool isWritable() const override;
111 
112  AbstractFSNode *getChild(const Common::String &n) const override;
113  bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const override;
114  AbstractFSNode *getParent() const override;
115 
117  Common::SeekableWriteStream *createWriteStream(bool atomic) override;
118  bool createDirectory() override;
119 };
120 
121 
122 #endif
bool isRootNode() const
Definition: amigaos-fs.h:67
Definition: str.h:59
~AmigaOSFilesystemNode() override
Common::String getName() const override
Definition: amigaos-fs.h:106
Definition: array.h:52
AbstractFSNode * getChild(const Common::String &n) const override
AbstractFSNode * getParent() const override
Definition: stream.h:745
bool isReadable() const override
Common::String getPath() const override
Definition: amigaos-fs.h:107
virtual AbstractFSList listVolumes() const
bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const override
Definition: ustr.h:57
ListMode
Definition: fs.h:86
Common::SeekableReadStream * createReadStream() override
Common::U32String getDisplayName() const override
Definition: amigaos-fs.h:105
BPTR _pFileLock
Definition: amigaos-fs.h:51
Definition: stream.h:351
Common::SeekableWriteStream * createWriteStream(bool atomic) override
bool createDirectory() override
Definition: amigaos-fs.h:44
Definition: abstract-fs.h:41
bool isWritable() const override
bool isDirectory() const override
Definition: amigaos-fs.h:108