ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

AmigaOSFilesystemNode Class Reference

Implementation of the ScummVM file system API. More...

#include <amigaos4-fs.h>

Inheritance diagram for AmigaOSFilesystemNode:
Collaboration diagram for AmigaOSFilesystemNode:

List of all members.

Public Member Functions

 AmigaOSFilesystemNode ()
 Creates an AmigaOSFilesystemNode with the root node as path.
 AmigaOSFilesystemNode (const Common::String &p)
 Creates an AmigaOSFilesystemNode for a given path.
 AmigaOSFilesystemNode (BPTR pLock, const char *pDisplayName=0)
 Creates an AmigaOSFilesystemNode given its lock and display name.
 AmigaOSFilesystemNode (const AmigaOSFilesystemNode &node)
 Copy constructor.
virtual ~AmigaOSFilesystemNode ()
 Destructor.
virtual bool exists () const
virtual Common::String getDisplayName () const
 Returns a human readable path string.
virtual Common::String getName () const
 Returns the last component of the path pointed by this FSNode.
virtual Common::String getPath () const
 Returns the 'path' of the current node, usable in fopen().
virtual bool isDirectory () const
 Indicates whether this path refers to a directory or not.
virtual bool isReadable () const
 Indicates whether the object referred by this path can be read from or not.
virtual bool isWritable () const
 Indicates whether the object referred by this path can be written to or not.
virtual AbstractFSNodegetChild (const Common::String &n) const
 Returns the child node with the given name.
virtual bool getChildren (AbstractFSList &list, ListMode mode, bool hidden) const
 Return a list of child nodes of this directory node.
virtual AbstractFSNodegetParent () const
 The parent node of this directory.
virtual
Common::SeekableReadStream
createReadStream ()
 Creates a SeekableReadStream instance corresponding to the file referred by this node.
virtual Common::WriteStreamcreateWriteStream ()
 Creates a WriteStream instance corresponding to the file referred by this node.
virtual bool create (bool isDirectoryFlag)
 Creates a file referred by this node.

Protected Member Functions

virtual AbstractFSList listVolumes () const
 Creates a list with all the volumes present in the root node.
bool isRootNode () const
 True if this is the pseudo root filesystem.

Protected Attributes

BPTR _pFileLock
 The main file lock.
Common::String _sDisplayName
Common::String _sPath
bool _bIsDirectory
bool _bIsValid
uint32 _nProt

Detailed Description

Implementation of the ScummVM file system API.

Parts of this class are documented in the base interface class, AbstractFSNode.

Definition at line 45 of file amigaos4-fs.h.


Constructor & Destructor Documentation

AmigaOSFilesystemNode::AmigaOSFilesystemNode (  ) 

Creates an AmigaOSFilesystemNode with the root node as path.

AmigaOSFilesystemNode::AmigaOSFilesystemNode ( const Common::String p  ) 

Creates an AmigaOSFilesystemNode for a given path.

Parameters:
path Common::String with the path the new node should point to.
AmigaOSFilesystemNode::AmigaOSFilesystemNode ( BPTR  pLock,
const char *  pDisplayName = 0 
)

Creates an AmigaOSFilesystemNode given its lock and display name.

Parameters:
pLock BPTR to the lock.
pDisplayName name to be used for display, in case not supplied the FilePart() of the filename will be used.
Note:
This shouldn't even be public as it's only internally, at best it should have been protected if not private.
AmigaOSFilesystemNode::AmigaOSFilesystemNode ( const AmigaOSFilesystemNode node  ) 

Copy constructor.

Note:
Needed because it duplicates the file lock.
virtual AmigaOSFilesystemNode::~AmigaOSFilesystemNode (  )  [virtual]

Destructor.


Member Function Documentation

virtual bool AmigaOSFilesystemNode::create ( bool  isDirectoryFlag  )  [virtual]

Creates a file referred by this node.

Parameters:
isDirectoryFlag true if created file must be a directory
Returns:
true if file is created successfully

Implements AbstractFSNode.

virtual Common::SeekableReadStream* AmigaOSFilesystemNode::createReadStream (  )  [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.

Returns:
pointer to the stream object, 0 in case of a failure

Implements AbstractFSNode.

virtual Common::WriteStream* AmigaOSFilesystemNode::createWriteStream (  )  [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.

Returns:
pointer to the stream object, 0 in case of a failure

Implements AbstractFSNode.

virtual bool AmigaOSFilesystemNode::exists (  )  const [virtual]

Implements AbstractFSNode.

virtual AbstractFSNode* AmigaOSFilesystemNode::getChild ( const Common::String name  )  const [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.

Note:
Handling calls on non-dir nodes gracefully makes it possible to switch to a lazy type detection scheme in the future.
Parameters:
name String containing the name of the child to create a new node.

Implements AbstractFSNode.

virtual bool AmigaOSFilesystemNode::getChildren ( AbstractFSList list,
ListMode  mode,
bool  hidden 
) const [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.

Parameters:
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.
Returns:
true if successful, false otherwise (e.g. when the directory does not exist).

Implements AbstractFSNode.

virtual Common::String AmigaOSFilesystemNode::getDisplayName (  )  const [inline, virtual]

Returns a human readable path string.

Note:
By default, this method returns the value of getName().

Reimplemented from AbstractFSNode.

Definition at line 106 of file amigaos4-fs.h.

virtual Common::String AmigaOSFilesystemNode::getName (  )  const [inline, 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/

Note:
This method is very architecture dependent, please check the concrete implementation for more information.

Implements AbstractFSNode.

Definition at line 107 of file amigaos4-fs.h.

virtual AbstractFSNode* AmigaOSFilesystemNode::getParent (  )  const [virtual]

The parent node of this directory.

The parent of the root is the root itself.

Implements AbstractFSNode.

virtual Common::String AmigaOSFilesystemNode::getPath (  )  const [inline, virtual]

Returns the 'path' of the current node, usable in fopen().

Implements AbstractFSNode.

Definition at line 108 of file amigaos4-fs.h.

virtual bool AmigaOSFilesystemNode::isDirectory (  )  const [inline, virtual]

Indicates whether this path refers to a directory or not.

Implements AbstractFSNode.

Definition at line 109 of file amigaos4-fs.h.

virtual bool AmigaOSFilesystemNode::isReadable (  )  const [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.

Returns:
bool true if the object can be read, false otherwise.

Implements AbstractFSNode.

bool AmigaOSFilesystemNode::isRootNode (  )  const [inline, protected]

True if this is the pseudo root filesystem.

Definition at line 68 of file amigaos4-fs.h.

virtual bool AmigaOSFilesystemNode::isWritable (  )  const [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.

Returns:
bool true if the object can be written to, false otherwise.

Implements AbstractFSNode.

virtual AbstractFSList AmigaOSFilesystemNode::listVolumes (  )  const [protected, virtual]

Creates a list with all the volumes present in the root node.


Member Data Documentation

Definition at line 56 of file amigaos4-fs.h.

Definition at line 57 of file amigaos4-fs.h.

Definition at line 58 of file amigaos4-fs.h.

The main file lock.

If this is NULL but _bIsValid is true, then this Node references the virtual filesystem root.

Definition at line 52 of file amigaos4-fs.h.

Definition at line 54 of file amigaos4-fs.h.

Definition at line 55 of file amigaos4-fs.h.


The documentation for this class was generated from the following file:


Generated on Sat May 25 2019 05:03:46 for ResidualVM by doxygen 1.7.1
curved edge   curved edge