zipoutputstream.h
Go to the documentation of this file.
#ifndef ZIPOUTPUTSTREAM_H
#define ZIPOUTPUTSTREAM_H
#include "zipios++/zipios-config.h"
#include "zipios++/meta-iostreams.h"
#include <string>
#include "zipios++/ziphead.h"
#include "zipios++/zipoutputstreambuf.h"
namespace zipios {
class ZipOutputStream : public std::ostream {
public:
explicit ZipOutputStream( std::ostream &os ) ;
explicit ZipOutputStream( const std::string &filename ) ;
void closeEntry() ;
void close() ;
void finish() ;
void putNextEntry( const ZipCDirEntry &entry ) ;
void putNextEntry(const std::string& entryName);
void setComment( const std::string& comment ) ;
void setLevel( int level ) ;
void setMethod( StorageMethod method ) ;
virtual ~ZipOutputStream() ;
private:
std::ofstream *ofs ;
ZipOutputStreambuf *ozf ;
};
} // namespace.
#endif
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
zipios::ZipCDirEntry
Specialization of ZipLocalEntry, that add fields for storing the extra information,...
Definition ziphead.h:102
zipios::ZipOutputStream::closeEntry
void closeEntry()
Closes the current entry updates its header with the relevant size information and positions the stre...
Definition zipoutputstream.cpp:33
zipios::ZipOutputStream::close
void close()
Calls finish and if the ZipOutputStream was created with a filename as a parameter that file is close...
Definition zipoutputstream.cpp:38
zipios::ZipOutputStream::ZipOutputStream
ZipOutputStream(std::ostream &os)
ZipOutputStream constructor.
Definition zipoutputstream.cpp:13
zipios::ZipOutputStream::finish
void finish()
Closes the current entry (if one is open), then writes the Zip Central Directory Structure closing th...
Definition zipoutputstream.cpp:45
zipios::ZipOutputStream::putNextEntry
void putNextEntry(const ZipCDirEntry &entry)
Begins writing the next entry.
Definition zipoutputstream.cpp:50
zipios::ZipOutputStream::setComment
void setComment(const std::string &comment)
Sets the global comment for the Zip archive.
Definition zipoutputstream.cpp:59
zipios::ZipOutputStream::setLevel
void setLevel(int level)
Sets the compression level to be used for subsequent entries.
Definition zipoutputstream.cpp:64
zipios::ZipOutputStream::~ZipOutputStream
virtual ~ZipOutputStream()
Destructor.
Definition zipoutputstream.cpp:74
zipios::ZipOutputStream::setMethod
void setMethod(StorageMethod method)
Sets the compression method to be used.
Definition zipoutputstream.cpp:69
zipios::ZipOutputStreambuf
ZipOutputStreambuf is a zip output streambuf filter.
Definition zipoutputstreambuf.h:17
zipios::StorageMethod
StorageMethod
The types used with FileEntry::setMethod and FileEntry::getMethod.
Definition fileentry.h:25
ziphead.h
Header file containing classes and functions for reading the central directory and local header field...
zipoutputstreambuf.h
Header file that defines ZipOutputStreambuf.