|
FIFE
|
Implements a Zip archive file source. More...
#include <zipsource.h>
Inheritance diagram for FIFE::ZipSource:
Collaboration diagram for FIFE::ZipSource: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 208 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 189 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 128 of file zipsource.cpp.
References FIFE::_log, FIFE::ZipTree::addNode(), FIFE::CF_HEADER, FIFE::ZipEntryData::comp, FIFE::ZipEntryData::crc32, FIFE::DE_HEADER, FL_DBG, FL_ERR, FIFE::RawData::getCurrentIndex(), FIFE::LF_HEADER, 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().
Here is the caller graph for this function:
|
private |
Definition at line 122 of file zipsource.cpp.
References m_zipfile, readFileToIndex(), and FIFE::RawData::setIndex().
Referenced by ZipSource().
Here is the caller graph for this function:
|
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().