~ubuntu-branches/debian/squeeze/sword/squeeze

« back to all changes in this revision

Viewing changes to include/swcomprs.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Glassey
  • Date: 2004-01-15 15:50:07 UTC
  • Revision ID: james.westby@ubuntu.com-20040115155007-n9mz4x0zxrs1isd3
Tags: upstream-1.5.7
ImportĀ upstreamĀ versionĀ 1.5.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/******************************************************************************
 
2
 *  swcomprs.h   - definition of Class SWCompress used for data compression
 
3
 *
 
4
 * $Id: swcomprs.h,v 1.8 2002/10/01 19:52:40 dglassey Exp $
 
5
 *
 
6
 * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
 
7
 *      CrossWire Bible Society
 
8
 *      P. O. Box 2528
 
9
 *      Tempe, AZ  85280-2528
 
10
 *
 
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.
 
14
 *
 
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.
 
19
 *
 
20
 */
 
21
 
 
22
#ifndef SWCOMPRS_H
 
23
#define SWCOMPRS_H
 
24
 
 
25
#include <defs.h>
 
26
 
 
27
SWORD_NAMESPACE_START
 
28
 
 
29
class SWDLLEXPORT SWCompress
 
30
{
 
31
  void Init ();
 
32
  void cycleStream ();
 
33
protected:
 
34
  char *buf, *zbuf, direct;     // 0 - encode; 1 - decode
 
35
  unsigned long zlen, zpos, pos, slen;
 
36
public:
 
37
    SWCompress ();
 
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
 
45
};
 
46
 
 
47
SWORD_NAMESPACE_END
 
48
#endif