00001 #ifndef RAGE_FILE_DRIVER_ZIP_H 00002 #define RAGE_FILE_DRIVER_ZIP_H 00003 00004 #include "RageFileDriver.h" 00005 00006 struct FileInfo; 00007 struct end_central_dir_record; 00008 class RageFileDriverZip: public RageFileDriver 00009 { 00010 public: 00011 RageFileDriverZip( CString path ); 00012 virtual ~RageFileDriverZip(); 00013 00014 RageFileBasic *Open( const CString &path, int mode, int &err ); 00015 void FlushDirCache( const CString &sPath ); 00016 00017 private: 00018 RageFile zip; 00019 vector<FileInfo *> Files; 00020 00021 void ParseZipfile(); 00022 static void ReadEndCentralRecord( RageFile &zip, end_central_dir_record &ec ); 00023 static int ProcessCdirFileHdr( RageFile &zip, FileInfo &info ); 00024 }; 00025 00026 #endif 00027 00028 /* 00029 * Copyright (c) 1990-2002 Info-ZIP. All rights reserved. 00030 * Copyright (c) 2003-2004 Glenn Maynard. All rights reserved. 00031 * 00032 * For the purposes of this copyright and license, "Info-ZIP" is defined as 00033 * the following set of individuals: 00034 * 00035 * Mark Adler, John Bush, Karl Davis, Harald Denker, Jean-Michel Dubois, 00036 * Jean-loup Gailly, Hunter Goatley, Ian Gorman, Chris Herborth, Dirk Haase, 00037 * Greg Hartwig, Robert Heath, Jonathan Hudson, Paul Kienitz, David Kirschbaum, 00038 * Johnny Lee, Onno van der Linden, Igor Mandrichenko, Steve P. Miller, 00039 * Sergio Monesi, Keith Owens, George Petrov, Greg Roelofs, Kai Uwe Rommel, 00040 * Steve Salisbury, Dave Smith, Christian Spieler, Antoine Verheijen, 00041 * Paul von Behren, Rich Wales, Mike White 00042 * 00043 * This software is provided "as is," without warranty of any kind, express 00044 * or implied. In no event shall Info-ZIP or its contributors be held liable 00045 * for any direct, indirect, incidental, special or consequential damages 00046 * arising out of the use of or inability to use this software. 00047 * 00048 * Permission is granted to anyone to use this software for any purpose, 00049 * including commercial applications, and to alter it and redistribute it 00050 * freely, subject to the following restrictions: 00051 * 00052 * 1. Redistributions of source code must retain the above copyright notice, 00053 * definition, disclaimer, and this list of conditions. 00054 * 00055 * 2. Redistributions in binary form (compiled executables) must reproduce 00056 * the above copyright notice, definition, disclaimer, and this list of 00057 * conditions in documentation and/or other materials provided with the 00058 * distribution. The sole exception to this condition is redistribution 00059 * of a standard UnZipSFX binary as part of a self-extracting archive; 00060 * that is permitted without inclusion of this license, as long as the 00061 * normal UnZipSFX banner has not been removed from the binary or disabled. 00062 * 00063 * 3. Altered versions--including, but not limited to, ports to new operating 00064 * systems, existing ports with new graphical interfaces, and dynamic, 00065 * shared, or static library versions--must be plainly marked as such 00066 * and must not be misrepresented as being the original source. Such 00067 * altered versions also must not be misrepresented as being Info-ZIP 00068 * releases--including, but not limited to, labeling of the altered 00069 * versions with the names "Info-ZIP" (or any variation thereof, including, 00070 * but not limited to, different capitalizations), "Pocket UnZip," "WiZ" 00071 * or "MacZip" without the explicit permission of Info-ZIP. Such altered 00072 * versions are further prohibited from misrepresentative use of the 00073 * Zip-Bugs or Info-ZIP e-mail addresses or of the Info-ZIP URL(s). 00074 * 00075 * 4. Info-ZIP retains the right to use the names "Info-ZIP," "Zip," "UnZip," 00076 * "UnZipSFX," "WiZ," "Pocket UnZip," "Pocket Zip," and "MacZip" for its 00077 * own source and binary releases. 00078 */ 00079