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

package.h

Go to the documentation of this file.
00001 /***************************************************************************
00002              package.h  -  File management in virtual file system
00003                              -------------------
00004     begin                : Wed Sep 18 2002
00005     copyright            : (C) 2002 by Reality Rift Studios
00006     email                : mattias@realityrift.com
00007  ***************************************************************************
00008 
00009  The contents of this file are subject to the Mozilla Public License Version
00010  1.1 (the "License"); you may not use this file except in compliance with
00011  the License. You may obtain a copy of the License at 
00012  http://www.mozilla.org/MPL/
00013 
00014  Software distributed under the License is distributed on an "AS IS" basis,
00015  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00016  for the specific language governing rights and limitations under the
00017  License.
00018 
00019  The Original Code is the NeoEngine, package.h
00020 
00021  The Initial Developer of the Original Code is Mattias Jansson.
00022  Portions created by Mattias Jansson are Copyright (C) 2002
00023  Reality Rift Studios. All Rights Reserved.
00024 
00025  ***************************************************************************/
00026 
00027 #ifndef __NEPACKAGE_H
00028 #define __NEPACKAGE_H
00029 
00030 
00037 #include "base.h"
00038 #include "loadableentity.h"
00039 #include "directory.h"
00040 
00041 #include <string>
00042 
00043 
00044 namespace NeoEngine
00045 {
00046 
00047 
00048 // External classes
00049 class FileManager;
00050 
00051 
00056 class NEOENGINE_API VirtualFileTemplate : public FileTemplate
00057 {
00058     public:
00059 
00061         int                                           m_iOffset;
00062 
00064         int                                           m_iSize;
00065 
00067         int                                           m_iFlags;
00068 
00070         int                                           m_aiData[4];
00071 
00073         Package                                      *m_pkPackage;
00074 
00075 
00082         virtual File                                 *AllocateFile( const std::string &rstrName, Directory *pkParent );
00083 };
00084 
00085 
00086 
00087 
00093 class NEOENGINE_API Package : public Directory, public LoadableEntity
00094 {
00095     public:
00096 
00100         enum FILEFLAG
00101         {
00103           FILEFLAG_NORMAL                             = 0x00000000,
00104         
00106           FILEFLAG_BZIP2_COMPRESSED                   = 0x00000001
00107         };
00108 
00109 
00110     protected:
00111 
00117         virtual bool                                  LoadNode( unsigned int uiFlags );
00118 
00123         void                                          ReadCluster( Directory *pkDirectory );
00124 
00125 
00126   public:
00127 
00134                                                       Package( Directory *pkParent, const std::string &rstrFile, FileManager *pkManager );
00135 
00139         virtual                                      ~Package();
00140 
00145         inline File                                  *GetBaseFile() { return m_pkFile; }
00146 };
00147 
00148 
00149 }; // namespace NeoEngine
00150 
00151 
00152 #endif  // __NEPACKAGE_H

Generated on Wed Jan 21 14:21:07 2004 for NeoEngine by doxygen 1.3.5