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

POSIX file system node where the top-level directory is a hardcoded list of drives. More...

#include <posix-drives-fs.h>

Inheritance diagram for DrivePOSIXFilesystemNode:
Collaboration diagram for DrivePOSIXFilesystemNode:

List of all members.

Classes

struct  Config

Public Types

enum  BufferingMode { kBufferingModeDisabled, kBufferingModeStdio, kBufferingModeScummVM }
typedef Common::Array
< Common::String
DrivesArray

Public Member Functions

 DrivePOSIXFilesystemNode (const Common::String &path, const Config &config)
 DrivePOSIXFilesystemNode (const Config &config)
Common::SeekableReadStreamcreateReadStream () override
 Creates a SeekableReadStream instance corresponding to the file referred by this node.
Common::WriteStreamcreateWriteStream () override
 Creates a WriteStream instance corresponding to the file referred by this node.
AbstractFSNodegetChild (const Common::String &n) const override
 Returns the child node with the given name.
bool getChildren (AbstractFSList &list, ListMode mode, bool hidden) const override
 Return a list of child nodes of this directory node.
AbstractFSNodegetParent () const override
 The parent node of this directory.

Protected Member Functions

AbstractFSNodemakeNode (const Common::String &path) const override

Private Member Functions

DrivePOSIXFilesystemNodegetChildWithKnownType (const Common::String &n, bool isDirectoryFlag) const
bool isDrive (const Common::String &path) const
void configureStream (StdioStream *stream)

Private Attributes

bool _isPseudoRoot
const Config_config

Detailed Description

POSIX file system node where the top-level directory is a hardcoded list of drives.

Definition at line 34 of file posix-drives-fs.h.


Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
kBufferingModeDisabled 

IO buffering is fully disabled.

kBufferingModeStdio 

IO buffering is enabled and uses the libc implemenation.

kBufferingModeScummVM 

IO buffering is enabled and uses ScummVM's buffering stream wraappers.

Definition at line 43 of file posix-drives-fs.h.


Constructor & Destructor Documentation

DrivePOSIXFilesystemNode::DrivePOSIXFilesystemNode ( const Common::String path,
const Config config 
)
DrivePOSIXFilesystemNode::DrivePOSIXFilesystemNode ( const Config config  ) 

Member Function Documentation

void DrivePOSIXFilesystemNode::configureStream ( StdioStream stream  )  [private]
Common::SeekableReadStream* DrivePOSIXFilesystemNode::createReadStream (  )  [override, 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

Reimplemented from POSIXFilesystemNode.

Common::WriteStream* DrivePOSIXFilesystemNode::createWriteStream (  )  [override, 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

Reimplemented from POSIXFilesystemNode.

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

Reimplemented from POSIXFilesystemNode.

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

Reimplemented from POSIXFilesystemNode.

DrivePOSIXFilesystemNode* DrivePOSIXFilesystemNode::getChildWithKnownType ( const Common::String n,
bool  isDirectoryFlag 
) const [private]
AbstractFSNode* DrivePOSIXFilesystemNode::getParent (  )  const [override, virtual]

The parent node of this directory.

The parent of the root is the root itself.

Reimplemented from POSIXFilesystemNode.

bool DrivePOSIXFilesystemNode::isDrive ( const Common::String path  )  const [private]
AbstractFSNode* DrivePOSIXFilesystemNode::makeNode ( const Common::String path  )  const [inline, override, protected, virtual]

Reimplemented from POSIXFilesystemNode.

Definition at line 36 of file posix-drives-fs.h.


Member Data Documentation

Definition at line 72 of file posix-drives-fs.h.

Definition at line 71 of file posix-drives-fs.h.


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


Generated on Sat Sep 26 2020 05:02:36 for ResidualVM by doxygen 1.7.1
curved edge   curved edge