zipios
2.2.0
Zipios -- a small C++ library that provides easy access to .zip files.
src
gzipoutputstreambuf.hpp
Go to the documentation of this file.
1
#pragma once
2
#ifndef GZIPOUTPUTSTREAMBUF_HPP
3
#define GZIPOUTPUTSTREAMBUF_HPP
4
5
/*
6
Zipios -- a small C++ library that provides easy access to .zip files.
7
8
Copyright (C) 2000-2007 Thomas Sondergaard
9
Copyright (C) 2015-2019 Made to Order Software Corporation
10
11
This library is free software; you can redistribute it and/or
12
modify it under the terms of the GNU Lesser General Public
13
License as published by the Free Software Foundation; either
14
version 2.1 of the License, or (at your option) any later version.
15
16
This library is distributed in the hope that it will be useful,
17
but WITHOUT ANY WARRANTY; without even the implied warranty of
18
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19
Lesser General Public License for more details.
20
21
You should have received a copy of the GNU Lesser General Public
22
License along with this library; if not, write to the Free Software
23
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24
*/
25
34
#include "
deflateoutputstreambuf.hpp
"
35
36
37
namespace
zipios
38
{
39
40
41
class
GZIPOutputStreambuf
:
public
DeflateOutputStreambuf
42
{
43
public
:
44
GZIPOutputStreambuf
(std::streambuf * outbuf,
FileEntry::CompressionLevel
compression_level);
45
virtual
~GZIPOutputStreambuf
()
override
;
46
47
void
setFilename
(std::string
const
& filename);
48
void
setComment
(std::string
const
& comment);
49
void
close
();
50
void
finish
();
51
52
protected
:
53
virtual
int
overflow
(
int
c = EOF)
override
;
54
virtual
int
sync
()
override
;
55
56
private
:
57
void
writeHeader
();
58
void
writeTrailer
();
59
void
writeInt
(uint32_t i);
60
61
std::string
m_filename
;
62
std::string
m_comment
;
63
bool
m_open
=
false
;
64
};
65
66
67
}
// zipios namespace
68
69
// Local Variables:
70
// mode: cpp
71
// indent-tabs-mode: nil
72
// c-basic-offset: 4
73
// tab-width: 4
74
// End:
75
76
// vim: ts=4 sw=4 et
77
#endif
zipios::DeflateOutputStreambuf
A class to handle stream deflate on the fly.
Definition:
deflateoutputstreambuf.hpp:48
zipios::FileEntry::CompressionLevel
int CompressionLevel
The compression level to be used to save an entry.
Definition:
fileentry.hpp:85
zipios::GZIPOutputStreambuf
Save the output stream buffer.
Definition:
gzipoutputstreambuf.hpp:42
zipios::GZIPOutputStreambuf::setComment
void setComment(std::string const &comment)
Definition:
gzipoutputstreambuf.cpp:83
zipios::GZIPOutputStreambuf::writeTrailer
void writeTrailer()
Definition:
gzipoutputstreambuf.cpp:176
zipios::GZIPOutputStreambuf::writeHeader
void writeHeader()
Definition:
gzipoutputstreambuf.cpp:134
zipios::GZIPOutputStreambuf::finish
void finish()
Finishes the compression.
Definition:
gzipoutputstreambuf.cpp:103
zipios::GZIPOutputStreambuf::sync
virtual int sync() override
Synchronize the buffer.
Definition:
gzipoutputstreambuf.cpp:128
zipios::GZIPOutputStreambuf::~GZIPOutputStreambuf
virtual ~GZIPOutputStreambuf() override
Ensures that the stream gets closed properly.
Definition:
gzipoutputstreambuf.cpp:71
zipios::GZIPOutputStreambuf::overflow
virtual int overflow(int c=EOF) override
Handle an overflow.
Definition:
gzipoutputstreambuf.cpp:116
zipios::GZIPOutputStreambuf::m_filename
std::string m_filename
Definition:
gzipoutputstreambuf.hpp:61
zipios::GZIPOutputStreambuf::close
void close()
Close the stream.
Definition:
gzipoutputstreambuf.cpp:93
zipios::GZIPOutputStreambuf::GZIPOutputStreambuf
GZIPOutputStreambuf(std::streambuf *outbuf, FileEntry::CompressionLevel compression_level)
Initialize a GZIPOutputStreambuf object.
Definition:
gzipoutputstreambuf.cpp:54
zipios::GZIPOutputStreambuf::writeInt
void writeInt(uint32_t i)
Definition:
gzipoutputstreambuf.cpp:184
zipios::GZIPOutputStreambuf::setFilename
void setFilename(std::string const &filename)
Definition:
gzipoutputstreambuf.cpp:77
zipios::GZIPOutputStreambuf::m_comment
std::string m_comment
Definition:
gzipoutputstreambuf.hpp:62
zipios::GZIPOutputStreambuf::m_open
bool m_open
Definition:
gzipoutputstreambuf.hpp:63
deflateoutputstreambuf.hpp
Header file that defines zipios::DeflateOutputStreambuf.
zipios
The zipios namespace includes the Zipios library definitions.
Definition:
backbuffer.cpp:36
Generated on Sat Jan 22 2022 00:00:00 for zipios by
1.9.1