58 if(!
init(compression_level))
136 unsigned char const flg(
149 os << static_cast<unsigned char>(0x1f);
150 os << static_cast<unsigned char>(0x8b);
151 os << static_cast<unsigned char>(0x08);
153 os << static_cast<unsigned char>(0x00);
154 os << static_cast<unsigned char>(0x00);
155 os << static_cast<unsigned char>(0x00);
156 os << static_cast<unsigned char>(0x00);
157 os << static_cast<unsigned char>(0x00);
158 os << static_cast<unsigned char>(0x00);
163 os << static_cast<unsigned char>(0x00);
169 os << static_cast<unsigned char>(0x00);
186 os << static_cast<unsigned char>( i & 0xFF);
187 os << static_cast<unsigned char>((i >> 8) & 0xFF);
188 os << static_cast<unsigned char>((i >> 16) & 0xFF);
189 os << static_cast<unsigned char>((i >> 24) & 0xFF);
File defining zipios::GZIPOutputStreambuf.
Various exceptions used throughout the Zipios++ library, all based on zipios::Exception.
virtual int overflow(int c=EOF)
Handle an overflow.
void closeStream()
Closing the stream.
virtual int overflow(int c=EOF) override
Handle an overflow.
virtual int sync()
Synchronize the buffer.
void setComment(std::string const &comment)
void writeInt(uint32_t i)
bool init(FileEntry::CompressionLevel compression_level)
Initialize the zlib library.
int CompressionLevel
The compression level to be used to save an entry.
void finish()
Finishes the compression.
void close()
Close the stream.
std::streambuf * m_outbuf
Exception used when it is not possible to move forward.
virtual ~GZIPOutputStreambuf() override
Ensures that the stream gets closed properly.
virtual int sync() override
Synchronize the buffer.
GZIPOutputStreambuf(std::streambuf *outbuf, FileEntry::CompressionLevel compression_level)
Initialize a GZIPOutputStreambuf object.
size_t getSize() const
Retrieve the size of the file deflated.
void setFilename(std::string const &filename)
uint32_t getCrc32() const
Get the CRC32 of the file.
A class to handle stream deflate on the fly.