/[pearpc]/src/tools/cstream.h
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /src/tools/cstream.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (show annotations)
Wed Sep 5 17:11:21 2007 UTC (16 years, 6 months ago) by dpavlin
File MIME type: text/plain
File size: 1374 byte(s)
import upstream CVS
1 /*
2 * HT Editor
3 * cstream.cc
4 *
5 * Copyright (C) 1999-2002 Sebastian Biallas (sb@web-productions.de)
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20 #ifndef __CSTREAM_H__
21 #define __CSTREAM_H__
22
23 #include "stream.h"
24
25 /*
26 * NEVER use CompressedStream for both reading and writing!
27 */
28
29 #define COMPRESSED_STREAM_DEFAULT_GRANULARITY 10240
30
31 class CompressedStream: public StreamLayer {
32 protected:
33 byte *buffer;
34 uint buffersize;
35 uint bufferpos;
36
37 bool flush_compressed();
38 bool flush_uncompressed();
39 public:
40 CompressedStream(Stream *stream, bool own_stream, uint granularity = COMPRESSED_STREAM_DEFAULT_GRANULARITY);
41 virtual ~CompressedStream();
42 /* extends StreamLayer */
43 virtual uint read(void *buf, uint size);
44 virtual uint write(const void *buf, uint size);
45 };
46
47 #endif

  ViewVC Help
Powered by ViewVC 1.1.26