20#include <wx/tarstrm.h>
21#include <wx/wfstream.h>
22#include <wx/zstream.h>
28 m_filePath( aFilePath )
46 wxZlibInputStream stream( zipFile, wxZLIB_GZIP );
47 wxTarInputStream tarStream( stream );
51 m_cache.resize( 2 * zipFile.GetLength() );
55 while( ( entry = tarStream.GetNextEntry() ) !=
nullptr )
63 size_t length = entry->GetSize();
69 if( offset + length >
m_cache.size() )
72 tarStream.Read( &
m_cache[offset], length );
90 wxFAIL_MSG( wxS(
"Unimplemented" ) );
97 if( aFilePath.IsEmpty() )
std::unordered_map< wxString, FILE_INFO > m_fileInfoCache
Cache of file info for a given file path.
long GetFileContents(const wxString &aFilePath, const unsigned char *aDest, size_t aMaxLen)
Retrieves a file with the given path from the cached archive.
long GetFilePointer(const wxString &aFilePath, const unsigned char **aDest)
Retrieves a pointer to a file with the given path from the cached archive.
wxString m_filePath
Path to the source archive file.
ASSET_ARCHIVE(const wxString &aFilePath, bool aLoadNow=true)
std::vector< unsigned char > m_cache
The full file contents.