gzipoutputstreambuf.h
Go to the documentation of this file.
#ifndef GZIPOUTPUTSTREAMBUF_H
#define GZIPOUTPUTSTREAMBUF_H
#include "zipios++/zipios-config.h"
#include <vector>
#include <zlib.h>
#include "zipios++/deflateoutputstreambuf.h"
namespace zipios {
class GZIPOutputStreambuf : public DeflateOutputStreambuf {
public:
explicit GZIPOutputStreambuf( streambuf *outbuf, bool del_outbuf = false ) ;
void setFilename( const string &filename );
void setComment( const string &comment );
void close() ;
void finish() ;
virtual ~GZIPOutputStreambuf() ;
protected:
virtual int overflow( int c = EOF ) ;
virtual int sync() ;
private:
void writeHeader();
void writeTrailer();
void writeInt(uint32 i);
std::string _filename;
std::string _comment;
bool _open ;
};
} // 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::DeflateOutputStreambuf::DeflateOutputStreambuf
DeflateOutputStreambuf(streambuf *outbuf, bool user_init=false, bool del_outbuf=false)
DeflateOutputStreambuf constructor.
Definition deflateoutputstreambuf.cpp:18
zipios::GZIPOutputStreambuf::finish
void finish()
Finishes the compression.
Definition gzipoutputstreambuf.cpp:37
zipios::GZIPOutputStreambuf::close
void close()
Calls finish.
Definition gzipoutputstreambuf.cpp:33
zipios::GZIPOutputStreambuf::GZIPOutputStreambuf
GZIPOutputStreambuf(streambuf *outbuf, bool del_outbuf=false)
GZIPOutputStreambuf constructor.
Definition gzipoutputstreambuf.cpp:19
zipios::GZIPOutputStreambuf::~GZIPOutputStreambuf
virtual ~GZIPOutputStreambuf()
Destructor.
Definition gzipoutputstreambuf.cpp:47
deflateoutputstreambuf.h
Header file that defines DeflateOutputStreambuf.