Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
om::fs::FileSystemNode Class Referenceabstract

A class that represents the interface for a node within the global file system. More...

#include <omFileSystemNode.h>

Inheritance diagram for om::fs::FileSystemNode:
om::fs::Directory om::fs::File

Public Member Functions

virtual ~FileSystemNode ()
 Destroy a file system node object. More...
 
UTF8String getName () const
 Return the name of the file system node, the last component of its path. More...
 
virtual Bool setName (const UTF8String &newName)=0
 Set the name of the file system node, the last component of its path. More...
 
UTF8String getExtension () const
 Return a string representing the extension of this node's file name. More...
 
const PathgetPath () const
 Return a path object representing the path to this file system node. More...
 
const UTF8String & getPathString () const
 Return a string representing the path to the file system node. More...
 
virtual Bool isFile () const =0
 Return whether or not the file system node is a file. More...
 
virtual Bool isDirectory () const =0
 Return whether or not the file system node is a directory. More...
 
Bool isAtRoot () const
 Return whether or not the file system node is at the root level of the file system. More...
 
virtual Bool exists () const =0
 Return whether or not this file system node exists. More...
 
virtual LargeSize getSize () const =0
 Return the total size of the file system node. More...
 
virtual time::Date getDateCreated () const
 Return the date when this file system node was created. More...
 
virtual time::Date getDateModified () const
 Return the date when this file system node was last modified. More...
 
virtual Bool create ()=0
 Create this file system node if it doesn't exist. More...
 
virtual Bool remove ()=0
 Remove this file system node and all children (if it is a directory). More...
 

Protected Member Functions

 FileSystemNode (const UTF8String &newPathString)
 Create a file system node that is represented by the specified path string. More...
 
 FileSystemNode (const Path &newPath)
 Create a file system node that is represented by the specified path. More...
 

Protected Attributes

Path path
 The path to this file system node. More...
 

Detailed Description

A class that represents the interface for a node within the global file system.

A file system node can be either a file or a directory. The file system node allows the user to query basic properties of the node (size, path, name, type) and to create and remove the referenced file system node.

Constructor & Destructor Documentation

virtual om::fs::FileSystemNode::~FileSystemNode ( )
inlinevirtual

Destroy a file system node object.

om::fs::FileSystemNode::FileSystemNode ( const UTF8String &  newPathString)
inlineprotected

Create a file system node that is represented by the specified path string.

om::fs::FileSystemNode::FileSystemNode ( const Path newPath)
inlineprotected

Create a file system node that is represented by the specified path.

Member Function Documentation

UTF8String om::fs::FileSystemNode::getName ( ) const
inline

Return the name of the file system node, the last component of its path.

virtual Bool om::fs::FileSystemNode::setName ( const UTF8String &  newName)
pure virtual

Set the name of the file system node, the last component of its path.

Implemented in om::fs::File, and om::fs::Directory.

UTF8String om::fs::FileSystemNode::getExtension ( ) const
inline

Return a string representing the extension of this node's file name.

The extension is defined as the characters after the last period '.' in the node's file name.

const Path& om::fs::FileSystemNode::getPath ( ) const
inline

Return a path object representing the path to this file system node.

const UTF8String& om::fs::FileSystemNode::getPathString ( ) const
inline

Return a string representing the path to the file system node.

virtual Bool om::fs::FileSystemNode::isFile ( ) const
pure virtual

Return whether or not the file system node is a file.

Implemented in om::fs::File, and om::fs::Directory.

virtual Bool om::fs::FileSystemNode::isDirectory ( ) const
pure virtual

Return whether or not the file system node is a directory.

Implemented in om::fs::File, and om::fs::Directory.

Bool om::fs::FileSystemNode::isAtRoot ( ) const
inline

Return whether or not the file system node is at the root level of the file system.

virtual Bool om::fs::FileSystemNode::exists ( ) const
pure virtual

Return whether or not this file system node exists.

Implemented in om::fs::File, and om::fs::Directory.

virtual LargeSize om::fs::FileSystemNode::getSize ( ) const
pure virtual

Return the total size of the file system node.

For files, this is the total size of the file. For directories, this is the total size of all child file system nodes.

Implemented in om::fs::File, and om::fs::Directory.

virtual time::Date om::fs::FileSystemNode::getDateCreated ( ) const
virtual

Return the date when this file system node was created.

virtual time::Date om::fs::FileSystemNode::getDateModified ( ) const
virtual

Return the date when this file system node was last modified.

virtual Bool om::fs::FileSystemNode::create ( )
pure virtual

Create this file system node if it doesn't exist.

If the file system node already exists, no operation is performed and FALSE is returned. If the creation operation was not successful, FALSE is returned. Otherwise, TRUE is returned and the node is created.

Implemented in om::fs::File, and om::fs::Directory.

virtual Bool om::fs::FileSystemNode::remove ( )
pure virtual

Remove this file system node and all children (if it is a directory).

Implemented in om::fs::File, and om::fs::Directory.

Member Data Documentation

Path om::fs::FileSystemNode::path
protected

The path to this file system node.


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