1
/******************************************************************************
2
* swcomprs.h - definition of Class SWCompress used for data compression
4
* $Id: swcomprs.h,v 1.8 2002/10/01 19:52:40 dglassey Exp $
6
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
7
* CrossWire Bible Society
11
* This program is free software; you can redistribute it and/or modify it
12
* under the terms of the GNU General Public License as published by the
13
* Free Software Foundation version 2.
15
* This program is distributed in the hope that it will be useful, but
16
* WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
* General Public License for more details.
29
class SWDLLEXPORT SWCompress
34
char *buf, *zbuf, direct; // 0 - encode; 1 - decode
35
unsigned long zlen, zpos, pos, slen;
38
virtual ~ SWCompress ();
39
virtual char *Buf (const char *buf = 0, unsigned long *len = 0);
40
virtual char *zBuf (unsigned long *len, char *buf = 0);
41
virtual unsigned long GetChars (char *buf, unsigned long len); // override for other than buffer compression
42
virtual unsigned long SendChars (char *buf, unsigned long len); // override for other than buffer compression
43
virtual void Encode (void); // override to provide compression algorythm
44
virtual void Decode (void); // override to provide compression algorythm