Zipios++
zipoutputstream.h
Go to the documentation of this file.
1 #ifndef ZIPOUTPUTSTREAM_H
2 #define ZIPOUTPUTSTREAM_H
3 
4 #include "zipios++/zipios-config.h"
5 
6 #include "zipios++/meta-iostreams.h"
7 
8 #include <string>
9 
10 #include "zipios++/ziphead.h"
12 
13 namespace zipios {
14 
18 class ZipOutputStream : public std::ostream {
19 public:
20 
24  explicit ZipOutputStream( std::ostream &os ) ;
25 
28  explicit ZipOutputStream( const std::string &filename ) ;
29 
34  void closeEntry() ;
35 
40  void close() ;
41 
46  void finish() ;
47 
51  void putNextEntry( const ZipCDirEntry &entry ) ;
52 
56  void putNextEntry(const std::string& entryName);
57 
59  void setComment( const std::string& comment ) ;
60 
62  void setLevel( int level ) ;
63 
66  void setMethod( StorageMethod method ) ;
67 
69  virtual ~ZipOutputStream() ;
70 
71 private:
72  std::ofstream *ofs ;
73  ZipOutputStreambuf *ozf ;
74 };
75 
76 } // namespace.
77 
78 #endif
79 
84 /*
85  Zipios++ - a small C++ library that provides easy access to .zip files.
86  Copyright (C) 2000 Thomas Søndergaard
87 
88  This library is free software; you can redistribute it and/or
89  modify it under the terms of the GNU Lesser General Public
90  License as published by the Free Software Foundation; either
91  version 2 of the License, or (at your option) any later version.
92 
93  This library is distributed in the hope that it will be useful,
94  but WITHOUT ANY WARRANTY; without even the implied warranty of
95  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
96  Lesser General Public License for more details.
97 
98  You should have received a copy of the GNU Lesser General Public
99  License along with this library; if not, write to the Free Software
100  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
101 */