The Nebula Device 3: IO::ZipFileSystem Class Reference

The Nebula Device 3

IO::ZipFileSystem Class Reference

#include <zipfilesystem.h>

Inheritance diagram for IO::ZipFileSystem:

IO::ArchiveFileSystem

Detailed Description

An archive filesystem wrapper for ZIP files.

Uses the zlib and the minizip package under the hood.

Limitations: No write access. No seek on compressed data, the ZipFileSystem will generally decompress an entire file into memory at once, so that the ZipStreamClass can provide random access on the decompressed data. Thus the typical "audio streaming scenario" is not possible from zip files (that's what XACT's sound banks is there for anyway ;)

How to fix the no-seek problem: zlib processes datas in chunks, and cannot seek randomly within a chunk, and the chunk size is dependent on the compress application being used to create the zip file(?), if those internals are known, it would be possible to write a chunked filesystem which keeps buffered chunks around for each client, probably not worth the effort. Another appoach would be to split stream-files into "chunk-files" before compressing, and to read the next complete chunk files when new data is needed. This approach doesn't require changes to the strip filesystem.

(C) 2006 Radon Labs GmbH

Public Member Functions

 ZipFileSystem ()
 constructor
virtual ~ZipFileSystem ()
 destructor
void Setup ()
 setup the archive file system
void Discard ()
 discard the archive file system
Ptr< ArchiveFindArchiveWithFile (const URI &fileUri) const
 find first archive which contains the file path
Ptr< ArchiveFindArchiveWithDir (const URI &dirUri) const
 find first archive which contains the directory path

Member Function Documentation

void IO::ZipFileSystem::Setup (  ) 

setup the archive file system

Setup the ZipFileSystem. Registers the ZipFileStream class.

Ptr< Archive > IO::ZipFileSystem::FindArchiveWithFile ( const URI uri  )  const

find first archive which contains the file path

This method takes a normal file URI and checks if the local path of the URI is contained as file entry in any mounted zip archive. If yes ptr to the zip archive is returned, otherwise a 0 pointer. NOTE: if the same path resides in several zip archives, it is currently not defined which one will be returned (the current implementation returns the first zip archive in alphabetical order which contains the file).

Ptr< Archive > IO::ZipFileSystem::FindArchiveWithDir ( const URI uri  )  const

find first archive which contains the directory path

Same as FindArchiveWithFile(), but checks for a directory entry in a zip file.