FIFE  be64c707dea6b3250bd4355bf5c825d25920087d
FIFE::VFSSource Class Referenceabstract

VFSSource abstract baseclass. More...

#include <vfssource.h>

+ Inheritance diagram for FIFE::VFSSource:
+ Collaboration diagram for FIFE::VFSSource:

Public Member Functions

 VFSSource (VFS *vfs)
 
virtual ~VFSSource ()
 
virtual bool fileExists (const std::string &file) const =0
 check if the given file exists More...
 
VFSgetVFS () const
 get the VFS this source is associated with. More...
 
virtual RawDataopen (const std::string &file) const =0
 open a file inside this source More...
 
virtual std::set< std::string > listFiles (const std::string &path) const =0
 list all files in a directory of this source More...
 
virtual std::set< std::string > listDirectories (const std::string &path) const =0
 list all directories in a directory of this source More...
 

Protected Member Functions

std::string fixPath (std::string path) const
 

Private Attributes

VFSm_vfs
 

Detailed Description

VFSSource abstract baseclass.

VFSSources are used to provide transparent access to diffrent archives/filesystems etc. Examples are VFSHostSystem

See also
VFS
VFSSourceProvider

Definition at line 46 of file vfssource.h.

Constructor & Destructor Documentation

◆ VFSSource()

FIFE::VFSSource::VFSSource ( VFS vfs)

Definition at line 36 of file vfssource.cpp.

◆ ~VFSSource()

FIFE::VFSSource::~VFSSource ( )
virtual

Definition at line 39 of file vfssource.cpp.

References m_vfs, and FIFE::VFS::removeSource().

Member Function Documentation

◆ fileExists()

virtual bool FIFE::VFSSource::fileExists ( const std::string &  file) const
pure virtual

check if the given file exists

Parameters
filefilename to check
Returns
true if it exists, false otherwise

Implemented in FIFE::DAT2, FIFE::VFSDirectory, FIFE::ZipSource, and FIFE::DAT1.

Referenced by FIFE::VFS::getSourceForFile().

+ Here is the caller graph for this function:

◆ fixPath()

std::string FIFE::VFSSource::fixPath ( std::string  path) const
protected

Definition at line 45 of file vfssource.cpp.

Referenced by getVFS(), FIFE::DAT1::loadFileList(), and FIFE::DAT2::readFileEntry().

+ Here is the caller graph for this function:

◆ getVFS()

VFS* FIFE::VFSSource::getVFS ( ) const
inline

get the VFS this source is associated with.

Definition at line 60 of file vfssource.h.

References fixPath(), listDirectories(), listFiles(), m_vfs, and open().

Referenced by FIFE::DAT1::open(), and FIFE::DAT2::open().

+ Here is the caller graph for this function:

◆ listDirectories()

virtual std::set<std::string> FIFE::VFSSource::listDirectories ( const std::string &  path) const
pure virtual

list all directories in a directory of this source

Parameters
pathpath to list directories in Will return an empty list on any error

Implemented in FIFE::DAT2, FIFE::VFSDirectory, FIFE::DAT1, and FIFE::ZipSource.

Referenced by getVFS().

+ Here is the caller graph for this function:

◆ listFiles()

virtual std::set<std::string> FIFE::VFSSource::listFiles ( const std::string &  path) const
pure virtual

list all files in a directory of this source

Parameters
pathpath to list files in Will return an empty list on any error

Implemented in FIFE::DAT2, FIFE::VFSDirectory, FIFE::DAT1, and FIFE::ZipSource.

Referenced by getVFS().

+ Here is the caller graph for this function:

◆ open()

virtual RawData* FIFE::VFSSource::open ( const std::string &  file) const
pure virtual

open a file inside this source

Parameters
filethe file to open
Returns
a new RawData*
Exceptions
CannotOpenFileif the file can't be found

Implemented in FIFE::DAT2, FIFE::VFSDirectory, FIFE::ZipSource, and FIFE::DAT1.

Referenced by getVFS(), and FIFE::VFS::open().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_vfs

VFS* FIFE::VFSSource::m_vfs
private

Definition at line 88 of file vfssource.h.

Referenced by getVFS(), and ~VFSSource().


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