FIFE
be64c707dea6b3250bd4355bf5c825d25920087d
|
VFSSourceProvider abstract baseclass. More...
#include <vfssourceprovider.h>
Public Member Functions | |
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... | |
VFS * | getVFS () const |
virtual bool | isReadable (const std::string &file) const =0 |
Check if a given file is readable for this VFSSource. More... | |
virtual VFSSource * | createSource (const std::string &file)=0 |
Create a new instance of a VFSSource initialized with the given file. More... | |
virtual VFSSource * | getSource (const std::string &path) const =0 |
Get the source instance of the path. More... | |
virtual bool | hasSource (const std::string &path) const =0 |
Check whether the provider already has created a source with that path. More... | |
Private Attributes | |
VFS * | m_vfs |
std::string | m_name |
VFSSourceProvider abstract baseclass.
If you add support for a new archive-type (like the fallout1&dat files) you should also create a new VFSSourceProvider for your VFSSource - once this is done its very easy to load new archives even without knowing their real type.
Definition at line 49 of file vfssourceprovider.h.
FIFE::VFSSourceProvider::VFSSourceProvider | ( | const std::string & | name | ) |
Definition at line 41 of file vfssourceprovider.cpp.
|
virtual |
Definition at line 44 of file vfssourceprovider.cpp.
|
pure virtual |
Create a new instance of a VFSSource initialized with the given file.
file | the filename to open (the archive-file) |
Implemented in FIFE::DirectoryProvider, and FIFE::ZipProvider.
Referenced by FIFE::VFS::createSource(), and getVFS().
const std::string & FIFE::VFSSourceProvider::getName | ( | ) | const |
Returns the name of this VFSSourceProvider.
Definition at line 55 of file vfssourceprovider.cpp.
References m_name.
Referenced by FIFE::VFS::addProvider(), and FIFE::VFS::createSource().
|
pure virtual |
Get the source instance of the path.
path | The source path |
Implemented in FIFE::DirectoryProvider, and FIFE::ZipProvider.
Referenced by getVFS(), FIFE::VFS::hasSource(), and FIFE::VFS::removeSource().
|
inline |
Definition at line 65 of file vfssourceprovider.h.
References createSource(), getSource(), hasSource(), isReadable(), and m_vfs.
Referenced by FIFE::ZipProvider::createSource(), FIFE::DirectoryProvider::createSource(), and FIFE::ZipProvider::isReadable().
|
pure virtual |
Check whether the provider already has created a source with that path.
path | The path to the source |
Implemented in FIFE::DirectoryProvider, and FIFE::ZipProvider.
Referenced by getVFS(), FIFE::VFS::hasSource(), and FIFE::VFS::removeSource().
|
pure virtual |
Check if a given file is readable for this VFSSource.
file | the filename to check |
Implemented in FIFE::DirectoryProvider, and FIFE::ZipProvider.
Referenced by FIFE::VFS::createSource(), and getVFS().
void FIFE::VFSSourceProvider::setVFS | ( | VFS * | vfs | ) |
Get the VFS this provider is using.
Providers will not be able to locate sources before a VFS is set. VFS::addProvider sets this automatically.
Definition at line 47 of file vfssourceprovider.cpp.
References FIFE::_log, FL_WARN, and m_vfs.
Referenced by FIFE::VFS::addProvider().
|
private |
Definition at line 102 of file vfssourceprovider.h.
Referenced by getName().
|
private |
Definition at line 101 of file vfssourceprovider.h.