Pentagram::Archive Class Reference

#include <Archive.h>

Inheritance diagram for Pentagram::Archive:

MusicFlex RawArchive ShapeArchive SoundFlex UsecodeFlex FontShapeArchive GumpShapeArchive MainShapeArchive SpeechFlex List of all members.

Public Member Functions

 ENABLE_RUNTIME_CLASSTYPE ()
 Archive ()
 Archive (ArchiveFile *af)
 Archive (IDataSource *ids)
 Archive (const std::string &path)
virtual ~Archive ()
bool addSource (ArchiveFile *af)
bool addSource (IDataSource *ids)
bool addSource (const std::string &path)
void cache ()
virtual void cache (uint32 index)=0
void uncache ()
virtual void uncache (uint32 index)=0
virtual bool isCached (uint32 index)=0
uint32 getCount () const

Protected Member Functions

uint8getRawObject (uint32 index, uint32 *sizep=0)
uint32 getRawSize (uint32 index)

Protected Attributes

uint32 count

Private Member Functions

ArchiveFilefindArchiveFile (uint32 index)

Private Attributes

std::vector< ArchiveFile * > sources

Detailed Description

Definition at line 29 of file Archive.h.


Constructor & Destructor Documentation

Pentagram::Archive::Archive (  ) 

create Archive without any input sources

Definition at line 34 of file Archive.cpp.

References count.

Pentagram::Archive::Archive ( ArchiveFile af  )  [explicit]

create Archive with a single input source

Definition at line 47 of file Archive.cpp.

References addSource(), and count.

Pentagram::Archive::Archive ( IDataSource ids  )  [explicit]

create Archive with a single input source, autodetecting the type Will create FlexFile, U8SaveFile or ZipFile; ids will be deleted.

Definition at line 53 of file Archive.cpp.

References addSource(), and count.

Pentagram::Archive::Archive ( const std::string &  path  )  [explicit]

create Archive with a single directory input source Will create DirFile.

Definition at line 59 of file Archive.cpp.

References addSource(), and count.

Pentagram::Archive::~Archive (  )  [virtual]

Definition at line 39 of file Archive.cpp.

References sources.


Member Function Documentation

bool Pentagram::Archive::addSource ( const std::string &  path  ) 

add directory input source (as the constructor)

Definition at line 96 of file Archive.cpp.

References addSource(), and ArchiveFile::isValid().

bool Pentagram::Archive::addSource ( IDataSource ids  ) 

add input source, autodetecting the type (as the constructor)

Definition at line 75 of file Archive.cpp.

References addSource(), FlexFile::isFlexFile(), U8SaveFile::isU8SaveFile(), ArchiveFile::isValid(), and ZipFile::isZipFile().

bool Pentagram::Archive::addSource ( ArchiveFile af  ) 

add input source. ArchiveFile will be deleted on destruction Input sources are used in the reversed order they are added. Effect of adding sources after having accessed objects is undef.

Definition at line 65 of file Archive.cpp.

References count, ArchiveFile::getIndexCount(), and sources.

Referenced by addSource(), and Archive().

virtual void Pentagram::Archive::cache ( uint32  index  )  [pure virtual]

Cache a single object.

Implemented in MusicFlex, SoundFlex, RawArchive, FontShapeArchive, and ShapeArchive.

void Pentagram::Archive::cache (  ) 

Cache all objects.

Definition at line 107 of file Archive.cpp.

References count.

Referenced by RawArchive::get_datasource(), RawArchive::get_object_nodel(), SoundFlex::getSample(), ShapeArchive::getShape(), and MusicFlex::getXMidi().

Pentagram::Archive::ENABLE_RUNTIME_CLASSTYPE (  ) 

Reimplemented in MusicFlex, SoundFlex, SpeechFlex, RawArchive, FontShapeArchive, GumpShapeArchive, MainShapeArchive, and ShapeArchive.

ArchiveFile * Pentagram::Archive::findArchiveFile ( uint32  index  )  [private]

Definition at line 135 of file Archive.cpp.

References n, and sources.

Referenced by getRawObject(), and getRawSize().

uint32 Pentagram::Archive::getCount (  )  const [inline]

Definition at line 81 of file Archive.h.

References count.

Referenced by Actor::giveTreasure(), WpnOvlayDat::load(), GameData::loadRemorseData(), GameData::loadU8Data(), ShapeViewerGump::OnKeyDown(), and SKFPlayer::run().

uint8 * Pentagram::Archive::getRawObject ( uint32  index,
uint32 sizep = 0 
) [protected]

Definition at line 119 of file Archive.cpp.

References findArchiveFile(), and ArchiveFile::getObject().

Referenced by SoundFlex::cache(), ShapeArchive::cache(), RawArchive::cache(), MusicFlex::cache(), FontShapeArchive::cache(), RawArchive::get_object(), MusicFlex::getAdlibTimbres(), MusicFlex::loadSongInfo(), and SpeechFlex::SpeechFlex().

uint32 Pentagram::Archive::getRawSize ( uint32  index  )  [protected]

Definition at line 127 of file Archive.cpp.

References findArchiveFile(), and ArchiveFile::getSize().

Referenced by RawArchive::get_datasource(), RawArchive::get_object(), RawArchive::get_size(), and SpeechFlex::SpeechFlex().

virtual bool Pentagram::Archive::isCached ( uint32  index  )  [pure virtual]

Check if an object is cached.

Implemented in MusicFlex, SoundFlex, RawArchive, and ShapeArchive.

virtual void Pentagram::Archive::uncache ( uint32  index  )  [pure virtual]

Uncache a single object Potentially dangerous. See uncache()

Implemented in MusicFlex, SoundFlex, RawArchive, and ShapeArchive.

void Pentagram::Archive::uncache (  ) 

Uncache all objects Potentially dangerous: all stored objects will be deleted; make sure they are no longer in use.

Definition at line 113 of file Archive.cpp.

References count.


Member Data Documentation

uint32 Pentagram::Archive::count [protected]

Definition at line 84 of file Archive.h.

Referenced by addSource(), Archive(), SoundFlex::cache(), ShapeArchive::cache(), RawArchive::cache(), MusicFlex::cache(), FontShapeArchive::cache(), cache(), RawArchive::get_datasource(), RawArchive::get_object(), RawArchive::get_object_nodel(), RawArchive::get_size(), getCount(), SoundFlex::getSample(), ShapeArchive::getShape(), MusicFlex::getXMidi(), SoundFlex::isCached(), ShapeArchive::isCached(), RawArchive::isCached(), MusicFlex::isCached(), GumpShapeArchive::loadGumpage(), SoundFlex::uncache(), ShapeArchive::uncache(), RawArchive::uncache(), MusicFlex::uncache(), and uncache().

std::vector<ArchiveFile*> Pentagram::Archive::sources [private]

Definition at line 90 of file Archive.h.

Referenced by addSource(), findArchiveFile(), and ~Archive().


The documentation for this class was generated from the following files:
Generated on Fri Jul 27 22:30:31 2007 for pentagram by  doxygen 1.4.7