Zipios++
gzipoutputstreambuf.h
Go to the documentation of this file.
1#ifndef GZIPOUTPUTSTREAMBUF_H
2#define GZIPOUTPUTSTREAMBUF_H
3
4#include "zipios++/zipios-config.h"
5
6#include <vector>
7
8#include <zlib.h>
9
11
12namespace zipios {
13
16public:
17
23 explicit GZIPOutputStreambuf( streambuf *outbuf, bool del_outbuf = false ) ;
24
25 void setFilename( const string &filename );
26 void setComment( const string &comment );
27
29 void close() ;
30
32 void finish() ;
33
35 virtual ~GZIPOutputStreambuf() ;
36
37protected:
38 virtual int overflow( int c = EOF ) ;
39 virtual int sync() ;
40
41private:
42 void writeHeader();
43 void writeTrailer();
44 void writeInt(uint32 i);
45
46 std::string _filename;
47 std::string _comment;
48 bool _open ;
49};
50
51
52} // namespace
53
54
55
56#endif
57
62/*
63 Zipios++ - a small C++ library that provides easy access to .zip files.
64 Copyright (C) 2000 Thomas Søndergaard
65
66 This library is free software; you can redistribute it and/or
67 modify it under the terms of the GNU Lesser General Public
68 License as published by the Free Software Foundation; either
69 version 2 of the License, or (at your option) any later version.
70
71 This library is distributed in the hope that it will be useful,
72 but WITHOUT ANY WARRANTY; without even the implied warranty of
73 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
74 Lesser General Public License for more details.
75
76 You should have received a copy of the GNU Lesser General Public
77 License along with this library; if not, write to the Free Software
78 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
79*/
DeflateOutputStreambuf is an output stream filter, that deflates the data that is written to it befor...
GZIPOutputStreambuf is a zip output streambuf filter.
void finish()
Finishes the compression.
virtual ~GZIPOutputStreambuf()
Destructor.
Header file that defines DeflateOutputStreambuf.