FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
FIFE::DirectoryProvider Class Reference

Provider for OS directories. More...

#include <directoryprovider.h>

+ Inheritance diagram for FIFE::DirectoryProvider:
+ Collaboration diagram for FIFE::DirectoryProvider:

Public Member Functions

 DirectoryProvider ()
 
virtual bool isReadable (const std::string &path) const
 Check if a given directory is readable. More...
 
virtual VFSSourcecreateSource (const std::string &path)
 Create a new instance of a VFSSource initialized with the given directory This will only pass if the path is readable and recognized as a directory as per the description of isReadable. More...
 
virtual VFSSourcegetSource (const std::string &path) const
 Get the source instance of the path. More...
 
virtual bool hasSource (const std::string &path) const
 Check whether the provider already has created a source with that path. More...
 
- Public Member Functions inherited from FIFE::VFSSourceProvider
 VFSSourceProvider (const std::string &name)
 
virtual ~VFSSourceProvider ()
 
const std::string & getName () const
 Returns the name of this VFSSourceProvider. More...
 
void setVFS (VFS *vfs)
 Get the VFS this provider is using. More...
 
VFSgetVFS () const
 

Private Attributes

std::string m_name
 
std::map< std::string, VFSSource * > m_sources
 

Detailed Description

Provider for OS directories.

Definition at line 43 of file directoryprovider.h.

Constructor & Destructor Documentation

FIFE::DirectoryProvider::DirectoryProvider ( )
inline

Definition at line 45 of file directoryprovider.h.

References createSource(), getSource(), hasSource(), and isReadable().

Member Function Documentation

FIFE::VFSSource * FIFE::DirectoryProvider::createSource ( const std::string &  path)
virtual

Create a new instance of a VFSSource initialized with the given directory This will only pass if the path is readable and recognized as a directory as per the description of isReadable.

Parameters
paththe directory to open
Returns
the new VFSSource

Implements FIFE::VFSSourceProvider.

Definition at line 42 of file directoryprovider.cpp.

References FIFE::VFSSourceProvider::getVFS(), hasSource(), isReadable(), and m_sources.

Referenced by DirectoryProvider().

+ Here is the caller graph for this function:

VFSSource * FIFE::DirectoryProvider::getSource ( const std::string &  path) const
virtual

Get the source instance of the path.

Parameters
pathThe source path
Returns
A VFSSource or NULL of none is present

Implements FIFE::VFSSourceProvider.

Definition at line 57 of file directoryprovider.cpp.

References hasSource(), and m_sources.

Referenced by DirectoryProvider().

+ Here is the caller graph for this function:

bool FIFE::DirectoryProvider::hasSource ( const std::string &  path) const
virtual

Check whether the provider already has created a source with that path.

Parameters
pathThe path to the source
Returns
true if the provider has already created a source with that path, false if not

Implements FIFE::VFSSourceProvider.

Definition at line 65 of file directoryprovider.cpp.

References m_sources.

Referenced by createSource(), DirectoryProvider(), and getSource().

+ Here is the caller graph for this function:

bool FIFE::DirectoryProvider::isReadable ( const std::string &  path) const
virtual

Check if a given directory is readable.

The path must either be an absolute path or relative to the current working directory where the client was launched

Parameters
paththe filename to check
Returns
true if readable, false otherwise

Implements FIFE::VFSSourceProvider.

Definition at line 38 of file directoryprovider.cpp.

Referenced by createSource(), and DirectoryProvider().

+ Here is the caller graph for this function:

Member Data Documentation

std::string FIFE::DirectoryProvider::m_name
private

Definition at line 79 of file directoryprovider.h.

std::map<std::string, VFSSource* > FIFE::DirectoryProvider::m_sources
private

Definition at line 80 of file directoryprovider.h.

Referenced by createSource(), getSource(), and hasSource().


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