Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Ogre::ArchiveEx Class Reference

Archive-handling class. More...

#include <OgreArchiveEx.h>

Inheritance diagram for Ogre::ArchiveEx:

Inheritance graph
[legend]
List of all members.

Public Methods

 ArchiveEx ()
 Default constructor.

 ArchiveEx (const String &name)
 Usual constructor - used by ArchiveManager.

virtual ~ArchiveEx ()
 Default destructor.

virtual void load ()=0
 Loads the archive.

virtual void unload ()=0
 Unloads the archive.

virtual bool fileOpen (const String &strFile, FILE **ppFile) const=0
virtual bool fileRead (const String &strFile, DataChunk **ppChunk) const=0
 Reads the contents of a file within the archive and copies it in the passed DataChunk.

virtual bool fileSave (FILE *pFile, const String &strPath, bool bOverwrite=false)=0
 Creates a new file in the archive and copies in it the contents of the file associated with the passed FILE stream.

virtual bool fileWrite (const DataChunk &refChunk, const String &strPath, bool bOverwrite=false)=0
 Creates a new file in the archive and copies in it the contents of the passed DataChunk.

virtual bool fileDele (const String &strFile)=0
 Deletes a file from the archive.

virtual bool fileMove (const String &strSrc, const String &strDest, bool bOverwrite)=0
 Moves a file within the archive.

virtual bool fileInfo (const String &strFile, FileInfo **ppInfo) const=0
 Retrieves information about a file within the archive.

virtual bool fileCopy (const String &strSrc, const String &strDest, bool bOverwrite)=0
 Copies a file within the archive.

virtual bool fileTest (const String &strFile) const=0
 Tests wheter a file within the archive can be succesfully read.

virtual std::vector< StringdirGetFiles (const String &strDir) const=0
 Finds the names of all the files within a directory inside the archive.

virtual std::vector< StringdirGetSubs (const String &strDir) const=0
 Finds the names of all the subdirectories within a directory inside the archive.

virtual bool dirDele (const String &strDir, bool bRecursive)=0
 Deletes a directory from the archive.

virtual bool dirMove (const String &strSrc, const String &strDest, bool bOverwrite)=0
virtual bool dirInfo (const String &strDir, FileInfo **ppInfo) const=0
virtual bool dirCopy (const String &strSrc, const String &strDest, bool bOverwrite)=0
virtual bool dirTest (const String &strDir) const=0
virtual std::vector< StringgetAllNamesLike (const String &strStartPath, const String &strPattern, bool bRecursive=true)=0
virtual bool _allowFileCaching () const=0
 This function gets called by the resource manager to know if it is okay to cahche all the files in the achive.

virtual size_t getSize (void) const
 Retrieves info about the size of the resource.

virtual void touch (void)
 'Touches' the resource to indicate it has been used.

time_t getLastAccess (void) const
 Gets the last time the resource was 'touched'.

const StringgetName (void) const
 Gets resource name.

ResourceHandle getHandle (void) const
bool isLoaded (void) const
 Returns true if the Resource has been loaded, false otherwise.

virtual void destroy ()
 A method to make the resource delete itself.


Protected Attributes

String mName
ResourceHandle mHandle
bool mIsLoaded
time_t mLastAccess
size_t mSize

Detailed Description

Archive-handling class.

Remarks:
This class is supposed to be subclassed in order to create specialised archive codecs that should reside in .DLL's/.so's.
Author:
Adrian Cearnau (cearny@cearny.ro)
Since:
31st of January 2002

Definition at line 47 of file OgreArchiveEx.h.


Constructor & Destructor Documentation

Ogre::ArchiveEx::ArchiveEx  
 

Default constructor.

Note:

Should never get called.

Definition at line 72 of file OgreArchiveEx.h.

Ogre::ArchiveEx::ArchiveEx const String   name
 

Usual constructor - used by ArchiveManager.

Warning:
Never call directly.

Definition at line 78 of file OgreArchiveEx.h.

References Ogre::String.

Ogre::ArchiveEx::~ArchiveEx   [virtual]
 

Default destructor.

Definition at line 30 of file OgreArchiveEx.cpp.


Member Function Documentation

virtual bool Ogre::ArchiveEx::_allowFileCaching   const [pure virtual]
 

This function gets called by the resource manager to know if it is okay to cahche all the files in the achive.

Remarks:
Allowing file caching may not always be a very good idea. For example, caching all the files on a distant web server would work very slowly.
Since:
29.04.2002

Implemented in Ogre::Zip.

virtual void Ogre::Resource::destroy void    [virtual, inherited]
 

A method to make the resource delete itself.

Note:
This exists because Resource objects could be created in other processes, and they need to be destroyed in the process that created them.

Definition at line 137 of file OgreResource.h.

virtual bool Ogre::ArchiveEx::dirCopy const String   strSrc,
const String   strDest,
bool    bOverwrite
[pure virtual]
 

Implemented in Ogre::Zip.

virtual bool Ogre::ArchiveEx::dirDele const String   strDir,
bool    bRecursive
[pure virtual]
 

Deletes a directory from the archive.

Parameters:
strDir  The path to the directory to delete.
bRecursive  If set to true, all the subdirectories of the given directory will also be deleted.
Returns:
If the function succeeds, true is returned.

If the function fails, false is returned.

Note:

If the directory contains other subdirectories, and the bRecursive parameter is set to false, only the files in the current directory are deleted and the directory will not be removed.

Implemented in Ogre::Zip.

virtual std::vector<String> Ogre::ArchiveEx::dirGetFiles const String   strDir const [pure virtual]
 

Finds the names of all the files within a directory inside the archive.

Parameters:
strDir  The directory's path.
Returns:
A StringVector containing all the files.

Implemented in Ogre::Zip.

virtual std::vector<String> Ogre::ArchiveEx::dirGetSubs const String   strDir const [pure virtual]
 

Finds the names of all the subdirectories within a directory inside the archive.

Parameters:
strDir  The directory's path.
Returns:
A StringVector containing the names of all the subdirectories.

Implemented in Ogre::Zip.

virtual bool Ogre::ArchiveEx::dirInfo const String   strDir,
FileInfo **    ppInfo
const [pure virtual]
 

Implemented in Ogre::Zip.

virtual bool Ogre::ArchiveEx::dirMove const String   strSrc,
const String   strDest,
bool    bOverwrite
[pure virtual]
 

Implemented in Ogre::Zip.

virtual bool Ogre::ArchiveEx::dirTest const String   strDir const [pure virtual]
 

Implemented in Ogre::Zip.

virtual bool Ogre::ArchiveEx::fileCopy const String   strSrc,
const String   strDest,
bool    bOverwrite
[pure virtual]
 

Copies a file within the archive.

Parameters:
strSrc  The source file.
strDest  The destination path.
bOverwrite  If set to true, a file with the same name already exists at the destination and appending or deleting is possible, the old file is deleted and a new one containing the new data is created.
Returns:
If the function succeeds, true is returned.

If the function fails, false is returned.

Implemented in Ogre::Zip.

virtual bool Ogre::ArchiveEx::fileDele const String   strFile [pure virtual]
 

Deletes a file from the archive.

Parameters:
strFile  The name of the file te be deleted.
Returns:
If the function succeeds, true is returned.

If the function fails, false is returned.

Implemented in Ogre::Zip.

virtual bool Ogre::ArchiveEx::fileInfo const String   strFile,
FileInfo **    ppInfo
const [pure virtual]
 

Retrieves information about a file within the archive.

Parameters:
strFile  The name of the file to retrieve information for.
ppInfo  Pointer to the memory address of a FileInfo struct that will be filled with the requested information.
Returns:
If the function succeeds, true is returned.

If the function fails, false is returned.

Implemented in Ogre::Zip.

virtual bool Ogre::ArchiveEx::fileMove const String   strSrc,
const String   strDest,
bool    bOverwrite
[pure virtual]
 

Moves a file within the archive.

Parameters:
strSrc  The source file.
strDest  The location within the archive where to move the file.
bOverwrite  If set to true, a file with the same name already exists at the destination and appending or deleting is possible, the old file is deleted and a new one containing the new data is created.
Returns:
If the function succeeds, true is returned.

If the function fails, false is returned.

Implemented in Ogre::Zip.

virtual bool Ogre::ArchiveEx::fileOpen const String   strFile,
FILE **    ppFile
const [pure virtual]
 

Implemented in Ogre::Zip.

virtual bool Ogre::ArchiveEx::fileRead const String   strFile,
DataChunk **    ppChunk
const [pure virtual]
 

Reads the contents of a file within the archive and copies it in the passed DataChunk.

Parameters:
strFile  The name of the file to read from the archive.
ppChunk  A pointer to the addres of a DataChunk class that will hold the file's contens.
Returns:
If the function succeeds, true is returned.

If the function fails, false is returned.

Implemented in Ogre::Zip.

Referenced by Ogre::OverlayManager::parseOverlayFile().

virtual bool Ogre::ArchiveEx::fileSave FILE *    pFile,
const String   strPath,
bool    bOverwrite = false
[pure virtual]
 

Creates a new file in the archive and copies in it the contents of the file associated with the passed FILE stream.

Parameters:
pFile  A valid FILE pointer that holds the file stream information.
strPath  The location inside the archive where the new file will be created.
bOverwrite  If set to true, a file with the same name already exists inside the archive and appending or deleting is possible, the old file is deleted and a new one containing the new data is created.
Returns:
If the function succeeds, true is returned.

If the function fails, false is returned.

Implemented in Ogre::Zip.

virtual bool Ogre::ArchiveEx::fileTest const String   strFile const [pure virtual]
 

Tests wheter a file within the archive can be succesfully read.

Parameters:
strFile  The name of the file to be tested.
Returns:
If the file can be read, true is returned.

If the file cannot be read, false is returned.

Implemented in Ogre::Zip.

virtual bool Ogre::ArchiveEx::fileWrite const DataChunk   refChunk,
const String   strPath,
bool    bOverwrite = false
[pure virtual]
 

Creates a new file in the archive and copies in it the contents of the passed DataChunk.

Parameters:
refChunk  A DataChunk class that contains the data to be written to the new file.
strPath  The location inside the archive where the new file will be created.
bOverwrite  If set to true, a file with the same name already exists inside the archive and appending or deleting is possible, the old file is deleted and a new one containing the new data is created.
Returns:
If the function succeeds, true is returned.

If the function fails, false is returned.

Implemented in Ogre::Zip.

virtual std::vector<String> Ogre::ArchiveEx::getAllNamesLike const String   strStartPath,
const String   strPattern,
bool    bRecursive = true
[pure virtual]
 

Implemented in Ogre::Zip.

Referenced by Ogre::ResourceManager::addArchiveEx(), and Ogre::ResourceManager::addCommonArchiveEx().

ResourceHandle Ogre::Resource::getHandle void    const [inherited]
 

Definition at line 120 of file OgreResource.h.

References Ogre::ResourceHandle.

Referenced by Ogre::Material::clone(), Ogre::BspLevel::loadQuake3Level(), and Ogre::ResourceManager::unload().

time_t Ogre::Resource::getLastAccess void    const [inherited]
 

Gets the last time the resource was 'touched'.

Definition at line 108 of file OgreResource.h.

const String& Ogre::Resource::getName void    const [inherited]
 

Gets resource name.

Reimplemented in Ogre::Material, and Ogre::Overlay.

Definition at line 115 of file OgreResource.h.

References Ogre::String.

Referenced by Ogre::D3D9Texture::_loadCubeTex(), Ogre::Mesh::_notifySkeleton(), Ogre::ResourceManager::add(), Ogre::PopupMenuGuiElement::addListItem(), Ogre::ListGuiElement::addListItem(), Ogre::PopupMenuGuiElement::addMenuItem(), Ogre::MeshManager::createPrefabPlane(), Ogre::TTYGuiElement::getFontName(), Ogre::TextAreaGuiElement::getFontName(), Ogre::PopupMenuGuiElement::getListItemName(), Ogre::ListGuiElement::getListItemName(), Ogre::GpuProgramUsage::getProgramName(), Ogre::MeshSerializer::importMesh(), Ogre::GLTexture::load(), Ogre::TextureManager::loadImage(), Ogre::TextureManager::loadRawData(), Ogre::FontManager::logBadAttrib(), Ogre::MeshSerializerImpl::readMeshLodInfo(), Ogre::MeshSerializerImpl::readMeshLodUsageGenerated(), Ogre::MeshSerializerImpl::readMeshLodUsageManual(), Ogre::PopupMenuGuiElement::removeListItem(), Ogre::ListGuiElement::removeListItem(), Ogre::SceneManager::setSkyBox(), Ogre::SceneManager::setSkyDome(), and Ogre::ResourceManager::unload().

virtual size_t Ogre::Resource::getSize void    const [virtual, inherited]
 

Retrieves info about the size of the resource.

Definition at line 93 of file OgreResource.h.

Referenced by Ogre::ResourceManager::unload().

bool Ogre::Resource::isLoaded void    const [inherited]
 

Returns true if the Resource has been loaded, false otherwise.

Definition at line 127 of file OgreResource.h.

Referenced by Ogre::GpuProgramUsage::_load(), Ogre::SceneManager::deriveShadowCasterPass(), Ogre::SceneManager::deriveShadowReceiverPass(), Ogre::Technique::isLoaded(), Ogre::D3D9Texture::load(), Ogre::D3D9Texture::unload(), and Ogre::D3D9Texture::~D3D9Texture().

virtual void Ogre::ArchiveEx::load   [pure virtual]
 

Loads the archive.

Remarks:
This initializes all the internal data of the class.
Warning:
Do not call this function directly, it is ment to be used only by the ArchiveManager class.

Implements Ogre::Resource.

Implemented in Ogre::Zip.

virtual void Ogre::Resource::touch void    [virtual, inherited]
 

'Touches' the resource to indicate it has been used.

Reimplemented in Ogre::Material.

Definition at line 100 of file OgreResource.h.

Referenced by Ogre::Mesh::clone(), Ogre::MeshManager::createCurvedIllusionPlane(), Ogre::MeshManager::createCurvedPlane(), Ogre::MeshManager::createPlane(), and Ogre::ResourceManager::load().

virtual void Ogre::ArchiveEx::unload   [pure virtual]
 

Unloads the archive.

Warning:
Do not call this function directly, it is ment to be used only by the ArchiveManager class.

Reimplemented from Ogre::Resource.

Implemented in Ogre::Zip.

Referenced by Ogre::ArchiveManager::~ArchiveManager().


Member Data Documentation

ResourceHandle Ogre::Resource::mHandle [protected, inherited]
 

Definition at line 57 of file OgreResource.h.

Referenced by Ogre::ResourceManager::add(), Ogre::Material::clone(), Ogre::Material::copyDetailsTo(), and Ogre::Material::operator=().

bool Ogre::Resource::mIsLoaded [protected, inherited]
 

Definition at line 58 of file OgreResource.h.

Referenced by Ogre::D3D9Texture::_initMembers(), Ogre::D3D9Texture::_loadCubeTex(), Ogre::D3D9Texture::_loadNormTex(), Ogre::D3D9Texture::_loadVolumeTex(), Ogre::Material::_notifyNeedsRecompile(), Ogre::Material::clone(), Ogre::D3DTexture::createSurface2D(), Ogre::D3DTexture::createSurface3D(), Ogre::D3D9Texture::D3D9Texture(), Ogre::D3DTexture::D3DTexture(), Ogre::DynLib::DynLib(), Ogre::Zip::load(), Ogre::SkeletonInstance::load(), Ogre::Skeleton::load(), Ogre::PatchMesh::load(), Ogre::Mesh::load(), Ogre::Material::load(), Ogre::HighLevelGpuProgram::load(), Ogre::GpuProgram::load(), Ogre::GLTexture::load(), Ogre::GLSLGpuProgram::load(), Ogre::Font::load(), Ogre::DynLib::load(), Ogre::D3D9Texture::load(), Ogre::D3D9GpuProgram::load(), Ogre::D3DTexture::load(), Ogre::BspLevel::load(), Ogre::D3D9Texture::loadImage(), Ogre::D3DTexture::loadImage(), Ogre::D3DTexture::loadImage3D(), Ogre::GLTexture::loadImages(), Ogre::Material::Material(), Ogre::Material::operator=(), Ogre::Skeleton::unload(), Ogre::Mesh::unload(), Ogre::Material::unload(), Ogre::HighLevelGpuProgram::unload(), Ogre::GLTexture::unload(), Ogre::Font::unload(), Ogre::DynLib::unload(), Ogre::D3D9Texture::unload(), Ogre::D3DTexture::unload(), and Ogre::BspLevel::~BspLevel().

time_t Ogre::Resource::mLastAccess [protected, inherited]
 

Definition at line 59 of file OgreResource.h.

Referenced by Ogre::Material::operator=().

String Ogre::Resource::mName [protected, inherited]
 

Definition at line 56 of file OgreResource.h.

Referenced by Ogre::Skeleton::_dumpContents(), Ogre::Mesh::_rationaliseBoneAssignments(), Ogre::GLSLProgram::attachToProgramObject(), Ogre::BspLevel::BspLevel(), Ogre::Mesh::buildEdgeList(), Ogre::Mesh::buildTangentVectors(), Ogre::Material::clone(), Ogre::Material::compile(), Ogre::GLSLProgram::compile(), Ogre::Material::copyDetailsTo(), Ogre::Quake3Shader::createAsMaterial(), Ogre::D3D9HLSLProgram::createLowLevelImpl(), Ogre::CgProgram::createLowLevelImpl(), Ogre::Font::createTextureFromFont(), Ogre::D3D9Texture::D3D9Texture(), Ogre::D3DTexture::D3DTexture(), Ogre::DynLib::DynLib(), Ogre::Font::Font(), Ogre::Mesh::generateLodLevels(), Ogre::Material::getBestTechnique(), Ogre::Overlay::getName(), Ogre::Material::getName(), Ogre::GLTexture::GLTexture(), Ogre::GpuProgram::GpuProgram(), Ogre::Zip::load(), Ogre::Skeleton::load(), Ogre::Mesh::load(), Ogre::GLTexture::load(), Ogre::Font::load(), Ogre::DynLib::load(), Ogre::D3DTexture::load(), Ogre::BspLevel::load(), Ogre::D3D9GpuFragmentProgram::loadFromMicrocode(), Ogre::D3D9GpuVertexProgram::loadFromMicrocode(), Ogre::GLSLProgram::loadFromSource(), Ogre::GLArbGpuProgram::loadFromSource(), Ogre::D3D9HLSLProgram::loadFromSource(), Ogre::D3D9GpuProgram::loadFromSource(), Ogre::CgProgram::loadFromSource(), Ogre::GLTexture::loadImages(), Ogre::Material::Material(), Ogre::Mesh::Mesh(), Ogre::Material::operator=(), Ogre::Overlay::Overlay(), Ogre::Quake3Shader::Quake3Shader(), Ogre::CgProgram::selectProfile(), Ogre::Mesh::setSkeletonName(), Ogre::Skeleton::Skeleton(), Ogre::StringResource::StringResource(), Ogre::Texture::Texture(), Ogre::Zip::unload(), Ogre::DynLib::unload(), Ogre::CgProgram::unloadImpl(), and Ogre::Zip::Zip().

size_t Ogre::Resource::mSize [protected, inherited]
 

Definition at line 60 of file OgreResource.h.

Referenced by Ogre::D3D9Texture::_setFinalAttributes(), Ogre::D3DTexture::loadImage(), Ogre::D3DTexture::loadImage3D(), Ogre::GLTexture::loadImages(), and Ogre::Material::operator=().


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

Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:50:46 2004