#include <morphos-fs.h>
Public Member Functions | |
MorphOSFilesystemNode () | |
MorphOSFilesystemNode (const Common::String &p) | |
MorphOSFilesystemNode (BPTR pLock, const char *pDisplayName=0) | |
MorphOSFilesystemNode (const MorphOSFilesystemNode &node) | |
~MorphOSFilesystemNode () override | |
bool | exists () const override |
Common::U32String | getDisplayName () const override |
Common::String | getName () const override |
Common::String | getPath () const override |
bool | isDirectory () const override |
bool | isReadable () const override |
bool | isWritable () const override |
AbstractFSNode * | getChild (const Common::String &n) const override |
bool | getChildren (AbstractFSList &list, ListMode mode, bool hidden) const override |
AbstractFSNode * | getParent () const override |
Common::SeekableReadStream * | createReadStream () override |
Common::SeekableWriteStream * | createWriteStream (bool atomic) override |
bool | createDirectory () override |
Public Member Functions inherited from AbstractFSNode | |
virtual | ~AbstractFSNode () |
virtual Common::SeekableReadStream * | createReadStreamForAltStream (Common::AltStreamType altStreamType) |
Protected Member Functions | |
virtual AbstractFSList | listVolumes () const |
bool | isRootNode () const |
Protected Attributes | |
BPTR | _pFileLock |
Common::String | _sDisplayName |
Common::String | _sPath |
bool | _bIsDirectory |
bool | _bIsValid |
uint32 | _nProt |
Additional Inherited Members | |
Static Public Member Functions inherited from AbstractFSNode | |
static Common::FSNode | makeFSNode (AbstractFSNode *realNode) |
Protected Types inherited from AbstractFSNode | |
typedef Common::FSNode::ListMode | ListMode |
Static Protected Member Functions inherited from AbstractFSNode | |
static const char * | lastPathComponent (const Common::String &str, const char sep) |
Implementation of the ScummVM file system API.
Parts of this class are documented in the base interface class, AbstractFSNode.
MorphOSFilesystemNode::MorphOSFilesystemNode | ( | ) |
Creates a MorphOSFilesystemNode with the root node as path.
MorphOSFilesystemNode::MorphOSFilesystemNode | ( | const Common::String & | p | ) |
Creates a MorphOSFilesystemNode for a given path.
path | Common::String with the path the new node should point to. |
MorphOSFilesystemNode::MorphOSFilesystemNode | ( | BPTR | pLock, |
const char * | pDisplayName = 0 |
||
) |
Creates a MorphOSFilesystemNode given its lock and display name.
pLock | BPTR to the lock. |
pDisplayName | name to be used for display, in case not supplied the FilePart() of the filename will be used. |
MorphOSFilesystemNode::MorphOSFilesystemNode | ( | const MorphOSFilesystemNode & | node | ) |
Copy constructor.
|
override |
Destructor.
|
protectedvirtual |
Creates a list with all the volumes present in the root node.
|
inlineprotected |
True if this is the pseudo root filesystem.
|
inlineoverridevirtual |
Returns a human readable path string.
Implements AbstractFSNode.
|
inlineoverridevirtual |
Returns the last component of the path pointed by this FSNode.
Examples (POSIX): /foo/bar.txt would return /bar.txt /foo/bar/ would return /bar/
Implements AbstractFSNode.
|
inlineoverridevirtual |
Returns the 'path' of the current node, usable in fopen().
Implements AbstractFSNode.
|
inlineoverridevirtual |
Indicates whether this path refers to a directory or not.
Implements AbstractFSNode.
|
inlineoverridevirtual |
Indicates whether the object referred by this path can be read from or not.
If the path refers to a directory, readability implies being able to read and list the directory entries.
If the path refers to a file, readability implies being able to read the contents of the file.
Implements AbstractFSNode.
|
inlineoverridevirtual |
Indicates whether the object referred by this path can be written to or not.
If the path refers to a directory, writability implies being able to modify the directory entry (i.e. rename the directory, remove it or write files inside of it).
If the path refers to a file, writability implies being able to write data to the file.
Implements AbstractFSNode.
|
overridevirtual |
Returns the child node with the given name. When called on a non-directory node, it should handle this gracefully by returning 0. When called with a name not matching any of the files/dirs contained in this directory, a valid node should be returned, which returns 'false' upon calling the exists() method. The idea is that this node can then still can be used to create a new file via the createWriteStream() method.
Example: Calling getChild() for a node with path "/foo/bar" using name="file.txt", would produce a new node with "/foo/bar/file.txt" as path.
name | String containing the name of the child to create a new node. |
Implements AbstractFSNode.
|
overridevirtual |
Return a list of child nodes of this directory node. If called on a node that does not represent a directory, false is returned.
list | List to put the contents of the directory in. |
mode | Mode to use while listing the directory. |
hidden | Whether to include hidden files or not in the results. |
Implements AbstractFSNode.
|
overridevirtual |
The parent node of this directory. The parent of the root is the root itself.
Implements AbstractFSNode.
|
overridevirtual |
Creates a SeekableReadStream instance corresponding to the file referred by this node. This assumes that the node actually refers to a readable file. If this is not the case, 0 is returned.
Implements AbstractFSNode.
|
overridevirtual |
Creates a WriteStream instance corresponding to the file referred by this node. This assumes that the node actually refers to a readable file. If this is not the case, 0 is returned.
When an atomic write stream is requested, the backend will write the data in a temporary file before moving it to its final destination.
atomic | Request for an atomic file write when closing. |
Implements AbstractFSNode.
|
overridevirtual |
Creates a directory referred by this node.
Implements AbstractFSNode.
|
protected |
The main file lock. If this is NULL but _bIsValid is true, then this Node references the virtual filesystem root.