#include <daeZAEUncompressHandler.h>
Public Member Functions | |
daeZAEUncompressHandler (const daeURI &zaeFile) | |
const std::string & | getRootFilePath () |
const std::string & | getTmpDir () |
bool | isZipFile () |
const std::string & | obtainRootFilePath () |
virtual | ~daeZAEUncompressHandler () |
Static Public Attributes | |
static const int | BUFFER_SIZE |
static const int | CASE_INSENSITIVE |
static const std::string | EMPTY_STRING |
static const std::string | MANIFEST_FILE_NAME |
static const std::string | MANIFEST_FILE_ROOT_ELEMENT_NAME |
Private Member Functions | |
bool | checkAndExtractInternalArchive (const std::string &filePath) |
daeZAEUncompressHandler (const daeZAEUncompressHandler ©) | |
bool | extractArchive (unzFile zipFile, const std::string &destDir) |
bool | extractFile (unzFile zipFile, const std::string &destDir) |
bool | findManifestRootElement (xmlTextReaderPtr xmlReader) |
daeZAEUncompressHandler & | operator= (const daeZAEUncompressHandler ©) |
bool | retrieveRootURIFromManifest (const std::string &tmpDir) |
Private Attributes | |
std::string | mRootFilePath |
std::string | mTmpDir |
bool | mValidZipFile |
unzFile | mZipFile |
const daeURI & | mZipFileURI |
Takes an URI to a ZAE file and extracts it to a temporary directory. Use obtainRootFilePath() to accomplish this.
The whole ZAE archive gets extracted because it is not specified how an URL pointing inside a ZAE archive should look like. By extracting the whole archive we can use the 'file' scheme.
Definition at line 24 of file daeZAEUncompressHandler.h.
daeZAEUncompressHandler::daeZAEUncompressHandler | ( | const daeZAEUncompressHandler & | copy | ) | [private] |
daeZAEUncompressHandler::daeZAEUncompressHandler | ( | const daeURI & | zaeFile | ) |
C-Tor.
zaeFile | URI to the ZAE file to open. |
virtual daeZAEUncompressHandler::~daeZAEUncompressHandler | ( | ) | [virtual] |
D-Tor.
bool daeZAEUncompressHandler::checkAndExtractInternalArchive | ( | const std::string & | filePath | ) | [private] |
Checks if an extracted file is a zip archive itself and extracts it.
bool daeZAEUncompressHandler::extractArchive | ( | unzFile | zipFile, | |
const std::string & | destDir | |||
) | [private] |
Iterates over zip archive and extracts each file.
bool daeZAEUncompressHandler::extractFile | ( | unzFile | zipFile, | |
const std::string & | destDir | |||
) | [private] |
Extracts the current file inside zip archive.
bool daeZAEUncompressHandler::findManifestRootElement | ( | xmlTextReaderPtr | xmlReader | ) | [private] |
Finds <dae_root> element in manifest.xml. Used by retrieveRootURIFromManifest().
const std::string& daeZAEUncompressHandler::getRootFilePath | ( | ) | [inline] |
Returns currently known path to root DAE of ZAE file. Only valid after obtainRootFilePath() has been called.
Definition at line 84 of file daeZAEUncompressHandler.h.
const std::string& daeZAEUncompressHandler::getTmpDir | ( | ) | [inline] |
Returns used temp dir.
Definition at line 89 of file daeZAEUncompressHandler.h.
bool daeZAEUncompressHandler::isZipFile | ( | ) | [inline] |
Returns true if this object has been initialized with a zip file.
Definition at line 73 of file daeZAEUncompressHandler.h.
const std::string& daeZAEUncompressHandler::obtainRootFilePath | ( | ) |
Extracts ZAE file and returns resulting path to the root DAE file.
daeZAEUncompressHandler& daeZAEUncompressHandler::operator= | ( | const daeZAEUncompressHandler & | copy | ) | [private] |
bool daeZAEUncompressHandler::retrieveRootURIFromManifest | ( | const std::string & | tmpDir | ) | [private] |
Tries to open manifest.xml inside tmpDir. On success it parses the XML file to find URI of root DAE.
const int daeZAEUncompressHandler::BUFFER_SIZE [static] |
Definition at line 54 of file daeZAEUncompressHandler.h.
const int daeZAEUncompressHandler::CASE_INSENSITIVE [static] |
Definition at line 52 of file daeZAEUncompressHandler.h.
const std::string daeZAEUncompressHandler::EMPTY_STRING [static] |
Definition at line 56 of file daeZAEUncompressHandler.h.
const std::string daeZAEUncompressHandler::MANIFEST_FILE_NAME [static] |
Definition at line 48 of file daeZAEUncompressHandler.h.
const std::string daeZAEUncompressHandler::MANIFEST_FILE_ROOT_ELEMENT_NAME [static] |
Definition at line 50 of file daeZAEUncompressHandler.h.
std::string daeZAEUncompressHandler::mRootFilePath [private] |
Definition at line 37 of file daeZAEUncompressHandler.h.
std::string daeZAEUncompressHandler::mTmpDir [private] |
Definition at line 40 of file daeZAEUncompressHandler.h.
bool daeZAEUncompressHandler::mValidZipFile [private] |
Definition at line 34 of file daeZAEUncompressHandler.h.
unzFile daeZAEUncompressHandler::mZipFile [private] |
Definition at line 28 of file daeZAEUncompressHandler.h.
const daeURI& daeZAEUncompressHandler::mZipFileURI [private] |
Definition at line 31 of file daeZAEUncompressHandler.h.