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://www.ogre3d.org/
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 
00032 namespace Ogre {
00033 
00034 #ifdef __BORLANDC__
00035     using namespace std;
00036 #endif
00037 
00047     class _OgreExport ArchiveEx : public Resource {
00048     public:
00054         struct FileInfo {
00056             char szFilename[260];
00057 
00059             int iCompSize;
00061             int iUncompSize;
00062 
00064             time_t iLastMod;
00065         };
00066 
00067     public:
00072         ArchiveEx() {}
00073 
00078         ArchiveEx( const String& name ) { mName = name; }
00079 
00082         virtual ~ArchiveEx() {}
00083 
00091         virtual void load()=0;
00092 
00098         virtual void unload()=0;
00099 
00100         virtual bool fileOpen( const String& strFile, FILE** ppFile ) const=0;
00101 
00114         virtual bool fileRead( const String& strFile, DataChunk** ppChunk ) const=0;
00115 
00134         virtual bool fileSave( FILE* pFile, const String& strPath, bool bOverwrite = false )=0;
00135 
00155         virtual bool fileWrite( const DataChunk& refChunk, const String& strPath, bool bOverwrite = false )=0;
00156 
00165         virtual bool fileDele( const String& strFile )=0;
00166 
00183         virtual bool fileMove( const String& strSrc, const String& strDest, bool bOverwrite )=0;
00184 
00196         virtual bool fileInfo( const String& strFile, FileInfo** ppInfo ) const=0;
00197 
00213         virtual bool fileCopy( const String& strSrc, const String& strDest, bool bOverwrite )=0;
00214 
00223         virtual bool fileTest( const String& strFile ) const=0;
00224 
00232         virtual std::vector<String> dirGetFiles( const String& strDir ) const=0;
00233 
00242         virtual std::vector<String> dirGetSubs( const String& strDir ) const=0;
00243 
00260         virtual bool dirDele( const String& strDir, bool bRecursive )=0;
00261         virtual bool dirMove( const String& strSrc, const String& strDest, bool bOverwrite )=0;
00262 
00263         virtual bool dirInfo( const String& strDir, FileInfo** ppInfo ) const=0;
00264         virtual bool dirCopy( const String& strSrc, const String& strDest, bool bOverwrite )=0;
00265 
00266         virtual bool dirTest( const String& strDir ) const=0;
00267 
00268         virtual std::vector<String> getAllNamesLike( const String& strStartPath, const String& strPattern, bool bRecursive=true )=0;
00269 
00278         virtual bool _allowFileCaching() const =0;
00279     };
00280 }
00281 
00282 #endif

Copyright © 2002-2003 by The OGRE Team
Last modified Fri May 14 23:21:51 2004