]> git.donarmstrong.com Git - flightcrew.git/blob - src/zipios/zipios++/gzipoutputstream.h
Imported Upstream version 0.7.2+dfsg
[flightcrew.git] / src / zipios / zipios++ / gzipoutputstream.h
1 #ifndef GZIPOUTPUTSTREAM_H
2 #define GZIPOUTPUTSTREAM_H
3
4 #include "zipios++/zipios-config.h"
5
6 #include "zipios++/meta-iostreams.h"
7
8 #include <string>
9
10 #include "zipios++/gzipoutputstreambuf.h"
11
12 namespace zipios {
13
14 /** \anchor GZIPOutputStream_anchor
15     GZIPOutputStream is an ostream that writes the output to a gz file. The
16     interface approximates the interface of the Java GZIPOutputStream. */
17 class GZIPOutputStream : public std::ostream {
18 public:
19
20   /** GZIPOutputStream constructor.
21       @param os ostream to which the compressed zip archive is written.
22     */
23   explicit GZIPOutputStream( std::ostream &os ) ;
24
25   /** GZIPOutputStream constructor.
26       @filename filename to write the gzip archive to. */
27   explicit GZIPOutputStream( const std::string &filename ) ;
28
29   void setFilename( const string &filename );
30   void setComment( const string &comment );
31   
32   /** Calls finish and closes the stream. */
33   void close() ;
34
35   /** Finishes the stream. */
36   void finish() ;
37
38   /** Destructor. */
39   virtual ~GZIPOutputStream() ;
40
41 private:
42   std::ofstream *ofs ;
43   GZIPOutputStreambuf *ozf ;
44 };
45  
46 } // namespace.
47
48 #endif
49
50 /** \file 
51     Header file that defines GZIPOutputStream.
52 */
53
54 /*
55   Zipios++ - a small C++ library that provides easy access to .zip files.
56   Copyright (C) 2000  Thomas Søndergaard
57   
58   This library is free software; you can redistribute it and/or
59   modify it under the terms of the GNU Lesser General Public
60   License as published by the Free Software Foundation; either
61   version 2 of the License, or (at your option) any later version.
62   
63   This library is distributed in the hope that it will be useful,
64   but WITHOUT ANY WARRANTY; without even the implied warranty of
65   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
66   Lesser General Public License for more details.
67   
68   You should have received a copy of the GNU Lesser General Public
69   License along with this library; if not, write to the Free Software
70   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
71 */