Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

ZIPFile.h

Go to the documentation of this file.
00001 //
00002 // ZIPFile.h
00003 //
00004 // Copyright (c) Shareaza Development Team, 2002-2005.
00005 // This file is part of SHAREAZA (www.shareaza.com)
00006 //
00007 // Shareaza is free software; you can redistribute it
00008 // and/or modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2 of
00010 // the License, or (at your option) any later version.
00011 //
00012 // Shareaza is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 // GNU General Public License for more details.
00016 //
00017 // You should have received a copy of the GNU General Public License
00018 // along with Shareaza; if not, write to the Free Software
00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 //
00021 
00022 #pragma once
00023 
00024 class CBuffer;
00025 
00026 
00027 class CZIPFile
00028 {
00029 // Construction
00030 public:
00031         CZIPFile(HANDLE hAttach = INVALID_HANDLE_VALUE);
00032         ~CZIPFile();
00033 
00034 // File Class
00035 public:
00036         class File
00037         {
00038         private:
00039                 friend class CZIPFile;
00040                 inline File() {};
00041                 CZIPFile*       m_pZIP;
00042         public:
00043                 CBuffer*        Decompress();
00044                 BOOL            Extract(LPCTSTR pszFile);
00045         public:
00046                 CString         m_sName;
00047                 QWORD           m_nSize;
00048         protected:
00049                 QWORD           m_nLocalOffset;
00050                 QWORD           m_nCompressedSize;
00051                 int                     m_nCompression;
00052                 BOOL            PrepareToDecompress(LPVOID pStream);
00053         };
00054 
00055 // Attributes
00056 protected:
00057         BOOL    m_bAttach;
00058         HANDLE  m_hFile;
00059         File*   m_pFile;
00060         int             m_nFile;
00061 
00062 // Operations
00063 public:
00064         BOOL    Open(LPCTSTR pszFile);
00065         BOOL    Attach(HANDLE hFile);
00066         BOOL    IsOpen() const;
00067         void    Close();
00068 public:
00069         int             GetCount() const;
00070         File*   GetFile(int nFile) const;
00071         File*   GetFile(LPCTSTR pszFile, BOOL bPartial = FALSE) const;
00072 protected:
00073         BOOL    LocateCentralDirectory();
00074         BOOL    ParseCentralDirectory(BYTE* pDirectory, DWORD nDirectory);
00075         BOOL    SeekToFile(File* pFile);
00076 
00077 };

Generated on Thu Dec 15 10:39:54 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2