File: HtZlibCodec.h

package info (click to toggle)
htdig 1%3A3.2.0b6-21
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 21,292 kB
  • sloc: ansic: 49,632; cpp: 46,468; sh: 17,400; xml: 4,180; perl: 2,543; makefile: 888; php: 79; asm: 14
file content (51 lines) | stat: -rw-r--r-- 1,573 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//
// HtZlibCodec.h
//
// HtZlibCodec: Provide a generic access to the zlib compression routines.
//              If zlib is not present, encode and decode are simply 
//              assignment functions.
//
// Part of the ht://Dig package   <https://htdig.sourceforge.net/>
// Copyright (c) 1995-2004 The ht://Dig Group
// For copyright details, see the file COPYING in your distribution
// or the GNU Library General Public License (LGPL) version 2 or later 
// <http://www.gnu.org/copyleft/lgpl.html>
//
// $Id: HtZlibCodec.h,v 1.4 2004/05/28 13:15:12 lha Exp $
//
//
#ifndef __HtZlibCodec_h
#define __HtZlibCodec_h

#include "htString.h"
#include "HtCodec.h"

class HtZlibCodec : public HtCodec
{
public:
  static HtZlibCodec *instance();
  ~HtZlibCodec();

  // Code what's in this string.
  String encode(const String &) const;

  // Decode what's in this string.
  String decode(const String &) const;

  // egcs-1.1 (and some earlier versions) always erroneously
  // warns (even without warning flags) about classic singleton
  // constructs ("only defines private constructors and has no
  // friends").  Rather than adding autoconf tests to shut these
  // versions up with -Wno-ctor-dtor-privacy, we fake normal
  // conformism for it here (the minimal effort).
  friend void my_friend_Harvey__a_faked_friend_function();

private:
  // Hide default-constructor, copy-constructor and assignment
  // operator, making this a singleton.
  HtZlibCodec();
  HtZlibCodec(const HtZlibCodec &);
  void operator= (const HtZlibCodec &);
};

#endif /* __HtZlibCodec_h */