xoreos  0.0.5
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Aurora::ZIPFile Class Reference

A class encapsulating ZIP files for resource archive access. More...

#include <zipfile.h>

Inheritance diagram for Aurora::ZIPFile:
Inheritance graph
[legend]
Collaboration diagram for Aurora::ZIPFile:
Collaboration graph
[legend]

Public Member Functions

 ZIPFile (Common::SeekableReadStream *zip)
 Take over this stream and read a ZIP file out of it. More...
 
 ~ZIPFile ()
 
const ResourceListgetResources () const
 Return the list of resources. More...
 
uint32 getResourceSize (uint32 index) const
 Return the size of a resource. More...
 
Common::SeekableReadStreamgetResource (uint32 index, bool tryNoCopy=false) const
 Return a stream of the resource's contents. More...
 
- Public Member Functions inherited from Aurora::Archive
 Archive ()
 
virtual ~Archive ()
 
virtual Common::HashAlgo getNameHashAlgo () const
 Return with which algorithm the name is hashed. More...
 
uint32 findResource (uint64 hash) const
 Return the index of the resource matching the hash, or 0xFFFFFFFF if not found. More...
 
uint32 findResource (const Common::UString &name, FileType type) const
 Return the index of the resource matching the name and type, or 0xFFFFFFFF if not found. More...
 

Private Member Functions

void load ()
 

Private Attributes

Common::ScopedPtr< Common::ZipFile_zipFile
 The actual zip file. More...
 
ResourceList _resources
 External list of resource names and types. More...
 

Additional Inherited Members

- Public Types inherited from Aurora::Archive
typedef std::list< ResourceResourceList
 

Detailed Description

A class encapsulating ZIP files for resource archive access.

Definition at line 42 of file zipfile.h.

Constructor & Destructor Documentation

◆ ZIPFile()

Aurora::ZIPFile::ZIPFile ( Common::SeekableReadStream zip)

Take over this stream and read a ZIP file out of it.

Definition at line 33 of file zipfile.cpp.

References _zipFile, load(), and Common::ScopedPtrBase< T, Deallocator >::reset().

Here is the call graph for this function:

◆ ~ZIPFile()

Aurora::ZIPFile::~ZIPFile ( )

Definition at line 41 of file zipfile.cpp.

Member Function Documentation

◆ getResource()

Common::SeekableReadStream * Aurora::ZIPFile::getResource ( uint32  index,
bool  tryNoCopy = false 
) const
virtual

Return a stream of the resource's contents.

Implements Aurora::Archive.

Definition at line 52 of file zipfile.cpp.

References _zipFile.

◆ getResources()

const Archive::ResourceList & Aurora::ZIPFile::getResources ( ) const
virtual

Return the list of resources.

Implements Aurora::Archive.

Definition at line 44 of file zipfile.cpp.

References _resources.

◆ getResourceSize()

uint32 Aurora::ZIPFile::getResourceSize ( uint32  index) const
virtual

Return the size of a resource.

Reimplemented from Aurora::Archive.

Definition at line 48 of file zipfile.cpp.

References _zipFile.

◆ load()

void Aurora::ZIPFile::load ( )
private

Definition at line 56 of file zipfile.cpp.

References _resources, _zipFile, Common::FilePath::getStem(), Aurora::Archive::Resource::index, Aurora::Archive::Resource::name, Aurora::Archive::Resource::type, and TypeMan.

Referenced by ZIPFile().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _resources

ResourceList Aurora::ZIPFile::_resources
private

External list of resource names and types.

Definition at line 62 of file zipfile.h.

Referenced by getResources(), and load().

◆ _zipFile

Common::ScopedPtr<Common::ZipFile> Aurora::ZIPFile::_zipFile
private

The actual zip file.

Definition at line 59 of file zipfile.h.

Referenced by getResource(), getResourceSize(), load(), and ZIPFile().


The documentation for this class was generated from the following files: