]> cygwin.com Git - cygwin-apps/setup.git/blame - compress.h
Remove .cvsignore
[cygwin-apps/setup.git] / compress.h
CommitLineData
b24c88b3
RC
1/*
2 * Copyright (c) 2001, Robert Collins.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * A copy of the GNU General Public License can be found at
10 * http://www.gnu.org/
11 *
12 * Written by Robert Collins <rbtcollins@hotmail.com>
13 *
14 */
15
c93bc6d0
MB
16#ifndef SETUP_COMPRESS_H
17#define SETUP_COMPRESS_H
b24c88b3 18
b16e07fc 19#include "io_stream.h"
b24c88b3
RC
20
21class compress:public io_stream
22{
23public:
24 /* Get a decompressed stream from a normal stream. If this function returns non-null
25 * a valid compress header was found. The io_stream pointer passed to decompress
26 * should be discarded. The old io_stream will be automatically closed when the
27 * decompression stream is closed
28 */
29 static io_stream *decompress (io_stream *);
30 /*
31 * To create a stream that will be compressed, you should open the url, and then get a new stream
32 * from compress::compress.
33 */
34 /* read data (duh!) */
b16e07fc 35 virtual ssize_t read (void *buffer, size_t len) = 0;
b24c88b3 36 /* provide data to (double duh!) */
b16e07fc 37 virtual ssize_t write (const void *buffer, size_t len) = 0;
b24c88b3 38 /* read data without removing it from the class's internal buffer */
b16e07fc
MB
39 virtual ssize_t peek (void *buffer, size_t len) = 0;
40 virtual long tell () = 0;
b24c88b3 41 /* try guessing this one */
b16e07fc 42 virtual int error () = 0;
b24c88b3
RC
43 /* Find out the next stream name -
44 * ie for foo.tar.gz, at offset 0, next_file_name = foo.tar
45 * for foobar that is an compress, next_file_name is the next
46 * extractable filename.
47 */
b16e07fc 48 virtual const char *next_file_name () = 0;
b24c88b3 49 /* if you are still needing these hints... give up now! */
b16e07fc 50 virtual ~compress () = 0;
b24c88b3
RC
51};
52
c93bc6d0 53#endif /* SETUP_COMPRESS_H */
This page took 0.088366 seconds and 5 git commands to generate.