# OgreArchive.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 (c) 2000-2005 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 _Archive_H__
    00026 #define _Archive_H__
    00027
    00028 #include "OgrePrerequisites.h"
    00029 #include "OgreString.h"
    00030 #include "OgreDataStream.h"
    00031 #include "OgreSharedPtr.h"
    00032 #include "OgreStringVector.h"
    00033
    00034 namespace Ogre {
    00035
    00041     struct FileInfo {
    00044         Archive* archive;
    00046         String filename;
    00048         String path;
    00050         String basename;
    00052         size_t compressedSize;
    00054         size_t uncompressedSize;
    00055     };
    00056
    00057     typedef std::vector<FileInfo> FileInfoList;
    00058     typedef SharedPtr<FileInfoList> FileInfoListPtr;
    00059
    00076     class _OgreExport Archive
    00077     {
    00078     protected:
    00080         String mName;
    00082         String mType;
    00083     public:
    00084
    00085
    00088         Archive( const String& name, const String& archType )
    00089             : mName(name), mType(archType) {}
    00090
    00093         virtual ~Archive() {}
    00094
    00096         const String& getName(void) const { return mName; }
    00097
    00099         virtual bool isCaseSensitive(void) const = 0;
    00100
    00108         virtual void load() = 0;
    00109
    00115         virtual void unload() = 0;
    00116
    00126         virtual DataStreamPtr open(const String& filename) const = 0;
    00127
    00136         virtual StringVectorPtr list(bool recursive = true ) = 0;
    00137
    00144         virtual FileInfoListPtr listFileInfo(bool recursive = true ) = 0;
    00145
    00155         virtual StringVectorPtr find(const String& pattern, bool recursive = true) = 0;
    00156
    00158         virtual bool exists(const String& filename) = 0;
    00159
    00168         virtual FileInfoListPtr findFileInfo(const String& pattern,
    00169             bool recursive = true) = 0;
    00170
    00172         const String& getType(void) const { return mType; }
    00173
    00174     };
    00175 }
    00176
    00177 #endif

Copyright © 2000-2005 by The OGRE Team
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Feb 12 12:59:41 2006