Gio.ZlibCompressor¶
class — extends GObject.Object, Converter
GZlibCompressor is an implementation of Converter that
compresses data using zlib.
Constructors¶
new¶
Creates a compressor.
Parameters:
format— the format to use for the compressed datalevel— compression level (0-9),-1for default
Methods¶
get_file_info¶
Gets the ZlibCompressor.file-info property.
get_os¶
Gets the ZlibCompressor.os property.
set_file_info¶
Sets the ZlibCompressor.file-info property.
Note: it is an error to call this function while a compression is in
progress; it may only be called immediately after creation of compressor,
or after resetting it with Converter.reset.
Parameters:
file_info— file info for the gzip header
set_os¶
Sets the ZlibCompressor.os property.
Note: it is an error to call this function while a compression is in
progress; it may only be called immediately after creation of compressor,
or after resetting it with Converter.reset.
Parameters:
os— the OS code to use, or-1to unset
Properties¶
file_info¶
A FileInfo containing file information to put into the gzip
header.
The file name and modification time from the file info will be used.
This will only be used if non-NULL and
ZlibCompressor.format is
ZlibCompressorFormat.GZIP.
format¶
The format of the compressed data.
level¶
The level of compression from 0 (no compression) to 9 (most
compression).
-1 for the default level.
os¶
The OS code of the gzip header.
This will be used if set to a non-negative value, and if
ZlibCompressor.format is
ZlibCompressorFormat.GZIP, the compressor will set the OS code of
the gzip header to this value.
If the value is unset, zlib will set the OS code depending on the platform.
This may be undesirable when reproducible output is desired. In that case setting
the OS code to 3 (for Unix) is recommended.