Public Types

deVFSContainer Class Reference

Virtual File System Container. More...

#include <deVFSContainer.h>

Inheritance diagram for deVFSContainer:
deVFSDiskDirectory deVFSMemoryFiles

List of all members.

Public Types

enum  eFileTypes { eftRegularFile, eftDirectory, eftSpecial, eftTypeCount }
 

File types.

More...

Public Member Functions

Constructors and Destructors
 deVFSContainer ()
 Creates a new virtual file system container with the root path '/'.
 deVFSContainer (decPath &rootPath)
 Creates a new virtual file system container with the given root path.
virtual ~deVFSContainer ()
 Cleans up the virtual file system container.
Management
decPathGetRootPath ()
 Retrieves the root path.
virtual bool ExistsFile (decPath &path)=0
 Determines if the specified file exists.
virtual bool CanReadFile (decPath &path)=0
 Determines if the specified file can be read from.
virtual bool CanWriteFile (decPath &path)=0
 Determines if the specified file can be written to.
virtual bool CanDeleteFile (decPath &path)=0
 Determines if the specified file can be deleted.
virtual decBaseFileReaderOpenFileForReading (decPath &path)=0
 Opens the specified file for reading.
virtual decBaseFileWriterOpenFileForWriting (decPath &path)=0
 Opens the specified file for writing.
virtual void DeleteFile (decPath &path)=0
 Deletes the specified file.
virtual void SearchFilesMatching (dePathList &list, decPath &pattern)=0
 Searches for all files and directories.
virtual int GetTypeOfFile (decPath &path)=0
 Retrieves the type of the specified file.

Detailed Description

Virtual File System Container.

A virtual file system container provides a collection of real or virtuel files. Containers can be queried for a listing of files, the existance of files and to open files for reading and writing. Each container has a path assigned where the root of the container is. All files and directories inside the container are inserted into the virtual file system under this path. The content does not replace the content of the given path as a mount command would do but adds the its own content to the content already existing. Duplicate files are shadowed in this process. The order of containers therefore matters.

Author:
Plüss Roland
Version:
1.0
Date:
2008

Member Enumeration Documentation

File types.

Enumerator:
eftRegularFile 

Regular file.

eftDirectory 

Directory.

eftSpecial 

A special file which is neither a regular file nor a directory.

eftTypeCount 

Dummy entry ( count of types )


Constructor & Destructor Documentation

deVFSContainer::deVFSContainer (  )

Creates a new virtual file system container with the root path '/'.

deVFSContainer::deVFSContainer ( decPath rootPath )

Creates a new virtual file system container with the given root path.

virtual deVFSContainer::~deVFSContainer (  ) [virtual]

Cleans up the virtual file system container.


Member Function Documentation

virtual bool deVFSContainer::CanDeleteFile ( decPath path ) [pure virtual]

Determines if the specified file can be deleted.

The path is relative to the root path.

Implemented in deVFSDiskDirectory, and deVFSMemoryFiles.

virtual bool deVFSContainer::CanReadFile ( decPath path ) [pure virtual]

Determines if the specified file can be read from.

The path is relative to the root path. The result of this call is usually the same as of ExistsFile unless permissions prevent reading of an existing file.

Implemented in deVFSDiskDirectory, and deVFSMemoryFiles.

virtual bool deVFSContainer::CanWriteFile ( decPath path ) [pure virtual]

Determines if the specified file can be written to.

The path is relative to the root path. If a file has parent directories not existing yet they have to be created in a subsequent call to OpenFileForWriting. If this is the case return true only if the creation of the parent directories is also allowed in addition to creating a new file. If the file exists permission flags can prevent writing.

Implemented in deVFSDiskDirectory, and deVFSMemoryFiles.

virtual void deVFSContainer::DeleteFile ( decPath path ) [pure virtual]

Deletes the specified file.

The path is relative to the root path.

Implemented in deVFSDiskDirectory, and deVFSMemoryFiles.

virtual bool deVFSContainer::ExistsFile ( decPath path ) [pure virtual]

Determines if the specified file exists.

The path is relative to the root path.

Implemented in deVFSDiskDirectory, and deVFSMemoryFiles.

decPath& deVFSContainer::GetRootPath (  ) [inline]

Retrieves the root path.

virtual int deVFSContainer::GetTypeOfFile ( decPath path ) [pure virtual]

Retrieves the type of the specified file.

If the file does not exist an exception is thrown.

Implemented in deVFSDiskDirectory, and deVFSMemoryFiles.

virtual decBaseFileReader* deVFSContainer::OpenFileForReading ( decPath path ) [pure virtual]

Opens the specified file for reading.

The path is relative to the root path. If the file can not be found an exception is raised. Use the CanReadFile function to test if a file can be opened for reading.

Implemented in deVFSDiskDirectory, and deVFSMemoryFiles.

virtual decBaseFileWriter* deVFSContainer::OpenFileForWriting ( decPath path ) [pure virtual]

Opens the specified file for writing.

The path is relative to the root path. If the file can not be found an exception is raised. Use the CanWriteFile function to test if a file can be opened for writing. Not existing directories have to be created if the CanWriteFile function returns true for a file whose parent directory does not exist yet.

Implemented in deVFSDiskDirectory, and deVFSMemoryFiles.

virtual void deVFSContainer::SearchFilesMatching ( dePathList list,
decPath pattern 
) [pure virtual]

Searches for all files and directories.

All found files and directories are added to the file listing.

Implemented in deVFSDiskDirectory, and deVFSMemoryFiles.


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