FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
FIFE::ZipProvider Class Reference

A VFS provider for Zip archives. More...

#include <zipprovider.h>

+ Inheritance diagram for FIFE::ZipProvider:
+ Collaboration diagram for FIFE::ZipProvider:

Public Member Functions

 ZipProvider ()
 
bool isReadable (const std::string &file) const
 Check if a given file is readable for this VFSSource. More...
 
VFSSourcecreateSource (const std::string &file)
 Create a new instance of a VFSSource initialized with the given file. More...
 
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::map< std::string, VFSSource * > m_sources
 

Detailed Description

A VFS provider for Zip archives.

See also
FIFE::VFSSourceProvider

Definition at line 43 of file zipprovider.h.

Constructor & Destructor Documentation

FIFE::ZipProvider::ZipProvider ( )
inline

Definition at line 45 of file zipprovider.h.

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

Member Function Documentation

FIFE::VFSSource * FIFE::ZipProvider::createSource ( const std::string &  file)
virtual

Create a new instance of a VFSSource initialized with the given file.

Parameters
filethe filename to open (the archive-file)
Returns
the new VFSSource

Implements FIFE::VFSSourceProvider.

Definition at line 54 of file zipprovider.cpp.

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

Referenced by ZipProvider().

+ Here is the caller graph for this function:

VFSSource * FIFE::ZipProvider::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 69 of file zipprovider.cpp.

References hasSource(), and m_sources.

Referenced by ZipProvider().

+ Here is the caller graph for this function:

bool FIFE::ZipProvider::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 77 of file zipprovider.cpp.

References m_sources.

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

+ Here is the caller graph for this function:

bool FIFE::ZipProvider::isReadable ( const std::string &  file) const
virtual

Check if a given file is readable for this VFSSource.

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

Implements FIFE::VFSSourceProvider.

Definition at line 38 of file zipprovider.cpp.

References FIFE::VFS::exists(), and FIFE::VFSSourceProvider::getVFS().

Referenced by createSource(), and ZipProvider().

+ Here is the caller graph for this function:

Member Data Documentation

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

Definition at line 52 of file zipprovider.h.

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


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