4 * Copyright (C) 2005-2013 Team XBMC
7 * This Program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
12 * This Program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with XBMC; see the file COPYING. If not, see
19 * <http://www.gnu.org/licenses/>.
25 #include "utils/log.h"
27 #include "ZipManager.h"
31 class CZipFile : public IFile
37 virtual int64_t GetPosition();
38 virtual int64_t GetLength();
39 virtual bool Open(const CURL& url);
40 virtual bool Exists(const CURL& url);
41 virtual int Stat(struct __stat64* buffer);
42 virtual int Stat(const CURL& url, struct __stat64* buffer);
43 virtual unsigned int Read(void* lpBuf, int64_t uiBufSize);
44 //virtual bool ReadString(char *szLine, int iLineLength);
45 virtual int64_t Seek(int64_t iFilePosition, int iWhence = SEEK_SET);
48 int UnpackFromMemory(std::string& strDest, const std::string& strInput, bool isGZ=false);
50 bool InitDecompress();
52 void DestroyBuffer(void* lpBuffer, int iBufSize);
55 int64_t m_iFilePos; // position in _uncompressed_ data read
56 int64_t m_iZipFilePos; // position in _compressed_ data
59 char m_szBuffer[65535]; // 64k buffer for compressed data
60 char* m_szStringBuffer;
61 char* m_szStartOfStringBuffer; // never allocated!
62 int m_iDataInStringBuffer;