2 #include "zipios++/zipios-config.h"
4 #include "zipios++/meta-iostreams.h"
6 #include "zipios++/zipoutputstreambuf.h"
7 #include "zipios++/zipoutputstream.h"
13 ZipOutputStream::ZipOutputStream( std::ostream &os )
15 // SGIs basic_ifstream calls istream with 0, but calls basic_ios constructor first??
18 ozf = new ZipOutputStreambuf( os.rdbuf() ) ;
24 ZipOutputStream::ZipOutputStream( const std::string &filename )
28 ofs = new std::ofstream( filename.c_str(), std::ios::out | std::ios::binary ) ;
29 ozf = new ZipOutputStreambuf( ofs->rdbuf() ) ;
33 void ZipOutputStream::closeEntry() {
38 void ZipOutputStream::close() {
45 void ZipOutputStream::finish() {
50 void ZipOutputStream::putNextEntry( const ZipCDirEntry &entry ) {
51 ozf->putNextEntry( entry ) ;
54 void ZipOutputStream::putNextEntry(const std::string& entryName) {
55 putNextEntry( ZipCDirEntry(entryName));
59 void ZipOutputStream::setComment( const std::string &comment ) {
60 ozf->setComment( comment ) ;
64 void ZipOutputStream::setLevel( int level ) {
65 ozf->setLevel( level ) ;
69 void ZipOutputStream::setMethod( StorageMethod method ) {
70 ozf->setMethod( method ) ;
74 ZipOutputStream::~ZipOutputStream() {
75 // It's ok to call delete with a Null pointer.
83 Implementation of ZipOutputStream.
87 Zipios++ - a small C++ library that provides easy access to .zip files.
88 Copyright (C) 2000 Thomas Søndergaard
90 This library is free software; you can redistribute it and/or
91 modify it under the terms of the GNU Lesser General Public
92 License as published by the Free Software Foundation; either
93 version 2 of the License, or (at your option) any later version.
95 This library is distributed in the hope that it will be useful,
96 but WITHOUT ANY WARRANTY; without even the implied warranty of
97 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
98 Lesser General Public License for more details.
100 You should have received a copy of the GNU Lesser General Public
101 License along with this library; if not, write to the Free Software
102 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA