#include <zipcomprs.h>
Definition at line 35 of file zipcomprs.h.
ZipCompress::~ZipCompress |
( |
| ) |
|
|
virtual |
void ZipCompress::decode |
( |
void |
| ) |
|
|
virtual |
Reimplemented from SWCompress.
Definition at line 314 of file zipcomprs.cpp.
337 char *
zbuf = (
char *)calloc(1, 1024);
338 char *chunkbuf =
zbuf;
340 unsigned long zlen = 0;
341 while((chunklen = (
int)
getChars(chunk, 1023))) {
342 memcpy(chunkbuf, chunk, chunklen);
346 else zbuf = (
char *)
realloc(zbuf, zlen + 1024);
347 chunkbuf = zbuf +
zlen;
352 unsigned long blen = zlen*20;
353 char *
buf =
new char[blen];
356 switch (uncompress((
Bytef*)buf, &blen, (
Bytef*)zbuf, zlen)){
static SWLog * getSystemLog()
virtual unsigned long getChars(char *buf, unsigned long len)
void logError(const char *fmt,...) const
virtual unsigned long sendChars(char *buf, unsigned long len)
void ZipCompress::encode |
( |
void |
| ) |
|
|
virtual |
Reimplemented from SWCompress.
Definition at line 251 of file zipcomprs.cpp.
273 char *
buf = (
char *)calloc(1, 1024);
274 char *chunkbuf =
buf;
275 unsigned long chunklen;
276 unsigned long len = 0;
277 while((chunklen =
getChars(chunk, 1023))) {
278 memcpy(chunkbuf, chunk, chunklen);
282 else buf = (
char *)
realloc(buf, len + 1024);
287 zlen = (long) (len*1.001)+15;
static SWLog * getSystemLog()
virtual unsigned long getChars(char *buf, unsigned long len)
void logError(const char *fmt,...) const
virtual unsigned long sendChars(char *buf, unsigned long len)
unsigned long SWCompress::getChars |
( |
char * |
buf, |
|
|
unsigned long |
len |
|
) |
| |
|
virtualinherited |
char * SWCompress::getCompressedBuf |
( |
unsigned long * |
len = 0 | ) |
|
|
virtualinherited |
Definition at line 111 of file swcomprs.cpp.
116 if (len) *len =
zlen;
virtual void encode(void)
virtual int SWCompress::getLevel |
( |
| ) |
|
|
inlinevirtualinherited |
char * SWCompress::getUncompressedBuf |
( |
unsigned long * |
len = 0 | ) |
|
|
virtualinherited |
Definition at line 90 of file swcomprs.cpp.
92 buf = (
char *)calloc(1,1);
virtual void decode(void)
unsigned long SWCompress::sendChars |
( |
char * |
buf, |
|
|
unsigned long |
len |
|
) |
| |
|
virtualinherited |
Definition at line 141 of file swcomprs.cpp.
145 if ((
pos + len) > (
unsigned)
slen) {
147 memset(&
buf[
pos], 0, len + 1024);
150 else buf = (
char *)calloc(1, len + 1024);
151 memmove(&
buf[
pos], ibuf, len);
162 zbuf = (
char *)calloc(1, len + 1024);
void SWCompress::setCompressedBuf |
( |
unsigned long * |
len, |
|
|
char * |
buf = 0 |
|
) |
| |
|
virtualinherited |
virtual void SWCompress::setLevel |
( |
int |
l | ) |
|
|
inlinevirtualinherited |
void SWCompress::setUncompressedBuf |
( |
const char * |
buf = 0 , |
|
|
unsigned long * |
len = 0 |
|
) |
| |
|
virtualinherited |
Definition at line 75 of file swcomprs.cpp.
78 slen = (len) ? *len : strlen(ibuf);
79 buf = (
char *) calloc(
slen + 1, 1);
83 buf = (
char *)calloc(1,1);
virtual void decode(void)
char ZipCompress::unTarGZ |
( |
int |
fd, |
|
|
const char * |
destPath |
|
) |
| |
|
static |
Definition at line 373 of file zipcomprs.cpp.
376 f = gzdopen(fd,
"rb");
382 return untar(f, destPath);
static SWLog * getSystemLog()
void logError(const char *fmt,...) const
|
mutableprotectedinherited |
|
mutableprotectedinherited |
unsigned long SWCompress::pos |
|
protectedinherited |
unsigned long SWCompress::slen |
|
protectedinherited |
|
mutableprotectedinherited |
unsigned long SWCompress::zlen |
|
protectedinherited |
unsigned long SWCompress::zpos |
|
protectedinherited |
The documentation for this class was generated from the following files: