FIFE
be64c707dea6b3250bd4355bf5c825d25920087d
|
Implements a Zip archive file source. More...
#include <zipsource.h>
Public Member Functions | |
ZipSource (VFS *vfs, const std::string &zip_file) | |
~ZipSource () | |
bool | fileExists (const std::string &file) const |
WARNING: fileExists, listFiles and listDirectories are not. More... | |
std::set< std::string > | listFiles (const std::string &path) const |
list all files in a directory of this source More... | |
std::set< std::string > | listDirectories (const std::string &path) const |
list all directories in a directory of this source More... | |
virtual RawData * | open (const std::string &path) const |
open a file inside this source More... | |
Public Member Functions inherited from FIFE::VFSSource | |
VFSSource (VFS *vfs) | |
virtual | ~VFSSource () |
VFS * | getVFS () const |
get the VFS this source is associated with. More... | |
Private Member Functions | |
void | readIndex () |
bool | readFileToIndex () |
Private Attributes | |
ZipTree | m_zipTree |
RawData * | m_zipfile |
Additional Inherited Members | |
Protected Member Functions inherited from FIFE::VFSSource | |
std::string | fixPath (std::string path) const |
Implements a Zip archive file source.
Definition at line 46 of file zipsource.h.
FIFE::ZipSource::ZipSource | ( | VFS * | vfs, |
const std::string & | zip_file | ||
) |
Definition at line 51 of file zipsource.cpp.
References readIndex().
FIFE::ZipSource::~ZipSource | ( | ) |
Definition at line 55 of file zipsource.cpp.
References m_zipfile.
|
virtual |
WARNING: fileExists, listFiles and listDirectories are not.
Implements FIFE::VFSSource.
Definition at line 59 of file zipsource.cpp.
References FIFE::ZipTree::getNode(), and m_zipTree.
|
virtual |
list all directories in a directory of this source
path | path to list directories in Will return an empty list on any error |
Implements FIFE::VFSSource.
Definition at line 209 of file zipsource.cpp.
References FIFE::ZipContentType::Directory, FIFE::ZipNode::getChildren(), FIFE::ZipTree::getNode(), and m_zipTree.
|
virtual |
list all files in a directory of this source
path | path to list files in Will return an empty list on any error |
Implements FIFE::VFSSource.
Definition at line 190 of file zipsource.cpp.
References FIFE::ZipContentType::File, FIFE::ZipNode::getChildren(), FIFE::ZipTree::getNode(), and m_zipTree.
|
virtual |
open a file inside this source
file | the file to open |
CannotOpenFile | if the file can't be found |
Implements FIFE::VFSSource.
Definition at line 64 of file zipsource.cpp.
References FIFE::_log, FIFE::ZipEntryData::comp, FL_DBG, FL_ERR, FIFE::ZipTree::getNode(), FIFE::ZipNode::getZipEntryData(), m_zipfile, m_zipTree, FIFE::ZipEntryData::offset, FIFE::RawData::readInto(), FIFE::RawData::setIndex(), FIFE::ZipEntryData::size_comp, and FIFE::ZipEntryData::size_real.
|
private |
Definition at line 129 of file zipsource.cpp.
References FIFE::_log, FIFE::ZipTree::addNode(), FIFE::ZipEntryData::comp, FIFE::ZipEntryData::crc32, FL_DBG, FL_ERR, FIFE::RawData::getCurrentIndex(), m_zipfile, m_zipTree, FIFE::RawData::moveIndex(), FIFE::ZipEntryData::offset, FIFE::RawData::read16Little(), FIFE::RawData::read32Little(), FIFE::RawData::readString(), FIFE::ZipNode::setZipEntryData(), FIFE::ZipEntryData::size_comp, and FIFE::ZipEntryData::size_real.
Referenced by readIndex().
|
private |
Definition at line 123 of file zipsource.cpp.
References m_zipfile, readFileToIndex(), and FIFE::RawData::setIndex().
Referenced by ZipSource().
|
private |
Definition at line 66 of file zipsource.h.
Referenced by open(), readFileToIndex(), readIndex(), and ~ZipSource().
|
private |
Definition at line 65 of file zipsource.h.
Referenced by fileExists(), listDirectories(), listFiles(), open(), and readFileToIndex().