ziptool.h revision 31c0d56f2ec3810c7917d23ebaba028dcee1f118
#ifndef __ZIPTOOL_H__
#define __ZIPTOOL_H__
/**
* This is intended to be a standalone, reduced capability
* implementation of Gzip and Zip functionality. Its
* targeted use case is for archiving and retrieving single files
* which use these encoding types. Being memory based and
* non-optimized, it is not useful in cases where very large
* archives are needed or where high performance is desired.
* However, it should hopefully work well for smaller,
* one-at-a-time tasks. What you get in return is the ability
* to drop these files into your project and remove the dependencies
* on ZLib and Info-Zip. Enjoy.
*
* Authors:
* Bob Jamison
*
* Copyright (C) 2006-2007 Bob Jamison
*
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <vector>
#include <string>
//########################################################################
//# A D L E R 3 2
//########################################################################
{
Adler32();
void reset();
void update(unsigned char b);
unsigned long getValue();
unsigned long value;
};
//########################################################################
//# C R C 3 2
//########################################################################
{
Crc32();
void reset();
void update(unsigned char b);
unsigned long getValue();
unsigned long value;
};
//########################################################################
//# G Z I P S T R E A M S
//########################################################################
{
/**
*
*/
GzipFile();
/**
*
*/
/**
*
*/
/**
*
*/
/**
*
*/
/**
*
*/
/**
*
*/
/**
*
*/
//######################
//# U T I L I T Y
//######################
/**
*
*/
//######################
//# W R I T E
//######################
/**
*
*/
/**
*
*/
/**
*
*/
//######################
//# R E A D
//######################
/**
*
*/
/**
*
*/
/**
*
*/
//debug messages
#ifdef G_GNUC_PRINTF
#endif
;
#ifdef G_GNUC_PRINTF
#endif
;
unsigned long crc;
unsigned long fileBufPos;
int compressionMethod;
};
//########################################################################
//# Z I P F I L E
//########################################################################
/**
*
*/
{
/**
*
*/
ZipEntry();
/**
*
*/
/**
*
*/
/**
*
*/
/**
*
*/
/**
*
*/
/**
*
*/
/**
*
*/
virtual unsigned long getCompressedSize();
/**
*
*/
virtual int getCompressionMethod();
/**
*
*/
/**
*
*/
/**
*
*/
/**
*
*/
virtual unsigned long getUncompressedSize();
/**
*
*/
/**
*
*/
/**
*
*/
/**
*
*/
/**
*
*/
/**
*
*/
/**
*
*/
/**
*
*/
/**
*
*/
virtual unsigned long getPosition();
unsigned long crc;
int compressionMethod;
unsigned long position;
};
/**
* This class sits over the zlib and gzip code to
* implement a PKWare or Info-Zip .zip file reader and
* writer
*/
{
/**
*
*/
ZipFile();
/**
*
*/
//######################
//# V A R I A B L E S
//######################
/**
*
*/
/**
*
*/
/**
* Return the list of entries currently in this file
*/
//######################
//# U T I L I T Y
//######################
/**
*
*/
/**
*
*/
//######################
//# W R I T E
//######################
/**
*
*/
/**
*
*/
/**
*
*/
//######################
//# R E A D
//######################
/**
*
*/
/**
*
*/
/**
*
*/
//debug messages
#ifdef G_GNUC_PRINTF
#endif
;
#ifdef G_GNUC_PRINTF
#endif
;
//# Private writing methods
/**
*
*/
/**
*
*/
/**
*
*/
/**
*
*/
bool writeFileData();
/**
*
*/
bool writeCentralDirectory();
//# Private reading methods
/**
*
*/
/**
*
*/
/**
*
*/
/**
*
*/
bool readFileData();
/**
*
*/
bool readCentralDirectory();
unsigned long fileBufPos;
};
#endif /* __ZIPTOOL_H__ */
//########################################################################
//# E N D O F F I L E
//########################################################################