Zipios++
zipios++
zipoutputstreambuf.h
Go to the documentation of this file.
1
#ifndef ZIPOUTPUTSTREAMBUF_H
2
#define ZIPOUTPUTSTREAMBUF_H
3
4
#include "zipios++/zipios-config.h"
5
6
#include <vector>
7
8
#include <zlib.h>
9
10
#include "
zipios++/fcoll.h
"
11
#include "
zipios++/deflateoutputstreambuf.h
"
12
#include "
zipios++/ziphead.h
"
13
14
namespace
zipios {
15
17
class
ZipOutputStreambuf
:
public
DeflateOutputStreambuf
{
18
public
:
19
20
enum
CompressionLevels { NO_COMPRESSION = Z_NO_COMPRESSION,
21
BEST_SPEED = Z_BEST_SPEED,
22
BEST_COMPRESSION = Z_BEST_COMPRESSION,
23
DEFAULT_COMPRESSION = Z_DEFAULT_COMPRESSION } ;
24
30
explicit
ZipOutputStreambuf
( streambuf *outbuf,
bool
del_outbuf =
false
) ;
31
34
void
closeEntry
() ;
35
37
void
close
() ;
38
43
void
finish
() ;
44
50
void
putNextEntry
(
const
ZipCDirEntry
&entry ) ;
51
53
void
setComment
(
const
string
&comment ) ;
54
56
void
setLevel
(
int
level ) ;
57
60
void
setMethod
(
StorageMethod
method ) ;
61
63
virtual
~ZipOutputStreambuf
() ;
64
65
protected
:
66
virtual
int
overflow(
int
c = EOF ) ;
67
virtual
int
sync() ;
68
69
void
setEntryClosedState() ;
70
void
updateEntryHeaderInfo() ;
71
72
// Should/could be moved to zipheadio.h ?!
73
static
void
writeCentralDirectory(
const
vector< ZipCDirEntry > &entries,
74
EndOfCentralDirectory
eocd,
75
ostream &os ) ;
76
77
78
79
private
:
80
string
_zip_comment ;
81
vector< ZipCDirEntry > _entries ;
82
bool
_open_entry ;
83
bool
_open ;
84
StorageMethod
_method ;
85
int
_level ;
86
};
87
88
89
}
// namespace
90
91
92
93
#endif
94
99
/*
100
Zipios++ - a small C++ library that provides easy access to .zip files.
101
Copyright (C) 2000 Thomas Søndergaard
102
103
This library is free software; you can redistribute it and/or
104
modify it under the terms of the GNU Lesser General Public
105
License as published by the Free Software Foundation; either
106
version 2 of the License, or (at your option) any later version.
107
108
This library is distributed in the hope that it will be useful,
109
but WITHOUT ANY WARRANTY; without even the implied warranty of
110
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
111
Lesser General Public License for more details.
112
113
You should have received a copy of the GNU Lesser General Public
114
License along with this library; if not, write to the Free Software
115
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
116
*/
fcoll.h
deflateoutputstreambuf.h
zipios::StorageMethod
StorageMethod
The types used with FileEntry::setMethod and FileEntry::getMethod.
Definition:
fileentry.h:25
zipios::EndOfCentralDirectory
The end of the Central directory structure.
Definition:
ziphead.h:159
zipios::ZipOutputStreambuf::finish
void finish()
Closes the current entry (if one is open), then writes the Zip Central Directory Structure closing th...
Definition:
zipoutputstreambuf.cpp:46
zipios::ZipOutputStreambuf::setMethod
void setMethod(StorageMethod method)
Sets the compression method to be used.
Definition:
zipoutputstreambuf.cpp:93
zipios::ZipOutputStreambuf::putNextEntry
void putNextEntry(const ZipCDirEntry &entry)
Begins writing the next entry.
Definition:
zipoutputstreambuf.cpp:61
zipios::ZipOutputStreambuf::~ZipOutputStreambuf
virtual ~ZipOutputStreambuf()
Destructor.
Definition:
zipoutputstreambuf.cpp:56
zipios::ZipCDirEntry
Specialization of ZipLocalEntry, that add fields for storing the extra information,...
Definition:
ziphead.h:102
ziphead.h
zipios::ZipOutputStreambuf::ZipOutputStreambuf
ZipOutputStreambuf(streambuf *outbuf, bool del_outbuf=false)
ZipOutputStreambuf constructor.
Definition:
zipoutputstreambuf.cpp:20
zipios::DeflateOutputStreambuf
DeflateOutputStreambuf is an output stream filter, that deflates the data that is written to it befor...
Definition:
deflateoutputstreambuf.h:25
zipios::ZipOutputStreambuf
ZipOutputStreambuf is a zip output streambuf filter.
Definition:
zipoutputstreambuf.h:17
zipios::ZipOutputStreambuf::close
void close()
Calls finish.
Definition:
zipoutputstreambuf.cpp:41
zipios::ZipOutputStreambuf::setComment
void setComment(const string &comment)
Sets the global comment for the Zip archive.
Definition:
zipoutputstreambuf.cpp:83
zipios::ZipOutputStreambuf::setLevel
void setLevel(int level)
Sets the compression level to be used for subsequent entries.
Definition:
zipoutputstreambuf.cpp:88
zipios::ZipOutputStreambuf::closeEntry
void closeEntry()
Closes the current entry, and positions the stream read pointer at the beginning of the next entry (i...
Definition:
zipoutputstreambuf.cpp:30
Generated by
1.8.17