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

OgreArchiveEx.h

Go to the documentation of this file.
00001 /*
00002 -----------------------------------------------------------------------------
00003 This source file is part of OGRE
00004     (Object-oriented Graphics Rendering Engine)
00005 For the latest info, see http://ogre.sourceforge.net/
00006 
00007 Copyright © 2000-2002 The OGRE Team
00008 Also see acknowledgements in Readme.html
00009 
00010 This program is free software; you can redistribute it and/or modify it under
00011 the terms of the GNU Lesser General Public License as published by the Free Software
00012 Foundation; either version 2 of the License, or (at your option) any later
00013 version.
00014 
00015 This program is distributed in the hope that it will be useful, but WITHOUT
00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
00018 
00019 You should have received a copy of the GNU Lesser General Public License along with
00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
00022 http://www.gnu.org/copyleft/lesser.txt.
00023 -----------------------------------------------------------------------------
00024 */
00025 #ifndef _ArchiveEx_H__
00026 #define _ArchiveEx_H__
00027 
00028 #include "OgrePrerequisites.h"
00029 
00030 #include "OgreResource.h"
00031 #include "OgreSingleton.h"
00032 #include "OgreDataChunk.h"
00033 
00034 #include "OgreStdHeaders.h"
00035 
00036 namespace Ogre {
00037 
00038 #ifdef __BORLANDC__
00039     using namespace std;
00040 #endif
00041 
00051     class _OgreExport ArchiveEx : public Resource {
00052     public:
00058         struct FileInfo {
00060             char szFilename[260];
00061 
00063             int iCompSize;
00065             int iUncompSize;
00066 
00068             time_t iLastMod;
00069         };
00070 
00071     public:
00076         ArchiveEx() {}
00077 
00082         ArchiveEx( const String& name ) { mName = name; }
00083 
00086         virtual ~ArchiveEx() {}
00087 
00095         virtual void load()=0;
00096 
00102         virtual void unload()=0;
00103 
00104         virtual bool fileOpen( const String& strFile, FILE** ppFile ) const=0;
00105 
00118         virtual bool fileRead( const String& strFile, DataChunk** ppChunk ) const=0;
00119 
00138         virtual bool fileSave( FILE* pFile, const String& strPath, bool bOverwrite = false )=0;
00139 
00159         virtual bool fileWrite( const DataChunk& refChunk, const String& strPath, bool bOverwrite = false )=0;
00160 
00169         virtual bool fileDele( const String& strFile )=0;
00170 
00187         virtual bool fileMove( const String& strSrc, const String& strDest, bool bOverwrite )=0;
00188 
00200         virtual bool fileInfo( const String& strFile, FileInfo** ppInfo ) const=0;
00201 
00217         virtual bool fileCopy( const String& strSrc, const String& strDest, bool bOverwrite )=0;
00218 
00227         virtual bool fileTest( const String& strFile ) const=0;
00228 
00236         virtual std::vector<String> dirGetFiles( const String& strDir ) const=0;
00237 
00246         virtual std::vector<String> dirGetSubs( const String& strDir ) const=0;
00247 
00264         virtual bool dirDele( const String& strDir, bool bRecursive )=0;
00265         virtual bool dirMove( const String& strSrc, const String& strDest, bool bOverwrite )=0;
00266 
00267         virtual bool dirInfo( const String& strDir, FileInfo** ppInfo ) const=0;
00268         virtual bool dirCopy( const String& strSrc, const String& strDest, bool bOverwrite )=0;
00269 
00270         virtual bool dirTest( const String& strDir ) const=0;
00271 
00272         virtual std::vector<String> getAllNamesLike( const String& strStartPath, const String& strPattern, bool bRecursive=true )=0;
00273 
00282         virtual bool _allowFileCaching() const =0;
00283     };
00284 }
00285 
00286 #endif

Copyright © 2002 by The OGRE Team