#include <abstract-fs.h>
Public Member Functions | |
virtual | ~AbstractFSNode () |
virtual bool | exists () const =0 |
virtual bool | getChildren (AbstractFSList &list, ListMode mode, bool hidden) const =0 |
virtual Common::U32String | getDisplayName () const =0 |
virtual Common::String | getName () const =0 |
virtual Common::String | getPath () const =0 |
virtual bool | isDirectory () const =0 |
virtual bool | isReadable () const =0 |
virtual bool | isWritable () const =0 |
virtual Common::SeekableReadStream * | createReadStream ()=0 |
virtual Common::SeekableReadStream * | createReadStreamForAltStream (Common::AltStreamType altStreamType) |
virtual Common::SeekableWriteStream * | createWriteStream (bool atomic)=0 |
virtual bool | createDirectory ()=0 |
Static Public Member Functions | |
static Common::FSNode | makeFSNode (AbstractFSNode *realNode) |
Protected Types | |
typedef Common::FSNode::ListMode | ListMode |
Protected Member Functions | |
virtual AbstractFSNode * | getChild (const Common::String &name) const =0 |
virtual AbstractFSNode * | getParent () const =0 |
Static Protected Member Functions | |
static const char * | lastPathComponent (const Common::String &str, const char sep) |
Abstract file system node. Private subclasses implement the actual functionality.
Most of the methods correspond directly to methods in class FSNode, so if they are not documented here, look there for more information about the semantics.
|
inlinevirtual |
Destructor.
|
protectedpure virtual |
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. |
Implemented in AddSAFFakeNode, AndroidSAFFilesystemNode, MorphOSFilesystemNode, AmigaOSFilesystemNode, LibRetroFilesystemNode, WindowsFilesystemNode, DrivePOSIXFilesystemNode, N64FilesystemNode, WiiFilesystemNode, POSIXFilesystemNode, RISCOSFilesystemNode, PSPFilesystemNode, KolibriOSFilesystemNode, and ChRootFilesystemNode.
|
protectedpure virtual |
The parent node of this directory. The parent of the root is the root itself.
Implemented in AddSAFFakeNode, AndroidSAFFilesystemNode, MorphOSFilesystemNode, AmigaOSFilesystemNode, LibRetroFilesystemNode, WindowsFilesystemNode, DrivePOSIXFilesystemNode, N64FilesystemNode, WiiFilesystemNode, POSIXFilesystemNode, RISCOSFilesystemNode, PSPFilesystemNode, KolibriOSFilesystemNode, and ChRootFilesystemNode.
|
staticprotected |
Returns the last component of a given path.
Examples: /foo/bar.txt would return /bar.txt /foo/bar/ would return /bar/
str | String containing the path. |
sep | character used to separate path components |
|
inlinestatic |
Construct a FSNode object from an AbstractFSNode object.
This is a helper to create Common::FSNode objects when the backend's FileSystemFactory cannot create the given AbstractFSNode object itself. All other code is supposed to use Common::FSNode's constructor itself.
realNode | Pointer to a heap allocated instance. FSNode will take ownership of the pointer. |
|
pure virtual |
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. |
Implemented in AddSAFFakeNode, AndroidSAFFilesystemNode, MorphOSFilesystemNode, AmigaOSFilesystemNode, LibRetroFilesystemNode, WindowsFilesystemNode, DrivePOSIXFilesystemNode, N64FilesystemNode, WiiFilesystemNode, POSIXFilesystemNode, RISCOSFilesystemNode, PSPFilesystemNode, KolibriOSFilesystemNode, and ChRootFilesystemNode.
|
pure virtual |
Returns a human readable path string.
Implemented in AddSAFFakeNode, AndroidSAFFilesystemNode, AmigaOSFilesystemNode, MorphOSFilesystemNode, WindowsFilesystemNode, LibRetroFilesystemNode, WiiFilesystemNode, POSIXFilesystemNode, RISCOSFilesystemNode, N64FilesystemNode, PSPFilesystemNode, KolibriOSFilesystemNode, and ChRootFilesystemNode.
|
pure virtual |
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/
Implemented in AddSAFFakeNode, AndroidSAFFilesystemNode, AmigaOSFilesystemNode, MorphOSFilesystemNode, WindowsFilesystemNode, LibRetroFilesystemNode, WiiFilesystemNode, POSIXFilesystemNode, RISCOSFilesystemNode, N64FilesystemNode, PSPFilesystemNode, KolibriOSFilesystemNode, and ChRootFilesystemNode.
|
pure virtual |
Returns the 'path' of the current node, usable in fopen().
Implemented in AddSAFFakeNode, AndroidSAFFilesystemNode, AmigaOSFilesystemNode, MorphOSFilesystemNode, LibRetroFilesystemNode, WindowsFilesystemNode, N64FilesystemNode, WiiFilesystemNode, POSIXFilesystemNode, RISCOSFilesystemNode, PSPFilesystemNode, KolibriOSFilesystemNode, and ChRootFilesystemNode.
|
pure virtual |
Indicates whether this path refers to a directory or not.
Implemented in AddSAFFakeNode, AndroidSAFFilesystemNode, AmigaOSFilesystemNode, MorphOSFilesystemNode, LibRetroFilesystemNode, WindowsFilesystemNode, N64FilesystemNode, WiiFilesystemNode, POSIXFilesystemNode, RISCOSFilesystemNode, PSPFilesystemNode, KolibriOSFilesystemNode, and ChRootFilesystemNode.
|
pure virtual |
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.
Implemented in AddSAFFakeNode, AndroidSAFFilesystemNode, AmigaOSFilesystemNode, MorphOSFilesystemNode, LibRetroFilesystemNode, WindowsFilesystemNode, N64FilesystemNode, WiiFilesystemNode, POSIXFilesystemNode, RISCOSFilesystemNode, PSPFilesystemNode, KolibriOSFilesystemNode, and ChRootFilesystemNode.
|
pure virtual |
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.
Implemented in AddSAFFakeNode, AndroidSAFFilesystemNode, AmigaOSFilesystemNode, MorphOSFilesystemNode, LibRetroFilesystemNode, WindowsFilesystemNode, N64FilesystemNode, WiiFilesystemNode, POSIXFilesystemNode, RISCOSFilesystemNode, PSPFilesystemNode, KolibriOSFilesystemNode, and ChRootFilesystemNode.
|
pure virtual |
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.
Implemented in AddSAFFakeNode, AndroidSAFFilesystemNode, MorphOSFilesystemNode, AmigaOSFilesystemNode, LibRetroFilesystemNode, WindowsFilesystemNode, N64FilesystemNode, WiiFilesystemNode, POSIXFilesystemNode, DrivePOSIXFilesystemNode, RISCOSFilesystemNode, PSPFilesystemNode, KolibriOSFilesystemNode, and ChRootFilesystemNode.
|
virtual |
Creates a SeekableReadStream instance corresponding to an alternate stream of the file referred by this node. This assumes that the node actually refers to a readable file and the alt stream exists. If either is not the case, 0 is returned.
Reimplemented in POSIXFilesystemNode.
|
pure virtual |
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. |
Implemented in AddSAFFakeNode, AndroidSAFFilesystemNode, MorphOSFilesystemNode, AmigaOSFilesystemNode, LibRetroFilesystemNode, WindowsFilesystemNode, N64FilesystemNode, POSIXFilesystemNode, WiiFilesystemNode, DrivePOSIXFilesystemNode, RISCOSFilesystemNode, PSPFilesystemNode, KolibriOSFilesystemNode, and ChRootFilesystemNode.
|
pure virtual |
Creates a directory referred by this node.
Implemented in AddSAFFakeNode, AndroidSAFFilesystemNode, MorphOSFilesystemNode, AmigaOSFilesystemNode, LibRetroFilesystemNode, WindowsFilesystemNode, N64FilesystemNode, POSIXFilesystemNode, WiiFilesystemNode, RISCOSFilesystemNode, PSPFilesystemNode, KolibriOSFilesystemNode, and ChRootFilesystemNode.