1.105 <GZlibCompressor>

Class: <GZlibCompressor>

It derives from <GObject>.

<GZlibCompressor> is an implementation of <GConverter> that compresses data using zlib.

Properties

Property: zlib-compressor:file-info self

A <GFileInfo> 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 zlib-compressor:format is Gio.ZlibCompressorFormat.GZIP.

Its value is a <GFileInfo>, or #f.

Set it with (set! (zlib-compressor:file-info self) value).

Property: zlib-compressor:format self

The format of the compressed data.

Its value is a <GZlibCompressorFormat> (or, to set it, one of its symbols).

It can only be set when the object is made, with #:format.

Property: zlib-compressor:level self

The level of compression from 0 (no compression) to 9 (most compression).

-1 for the default level.

Its value is a 32-bit integer.

It can only be set when the object is made, with #:level.

Property: zlib-compressor:os self

The OS code of the gzip header.

This will be used if set to a non-negative value, and if zlib-compressor:format is Gio.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.

Its value is a 32-bit integer.

Set it with (set! (zlib-compressor:os self) value).

Procedures

Method: zlib-compressor:get-file-info self ⇒ %return
Method: get-file-info self ⇒ %return

Gets the zlib-compressor:file-info property.

self

Passed: a <GZlibCompressor>.

a compressor

%return

Returned: a <GFileInfo>, or #f.

file info for the gzip header, if set

Method: zlib-compressor:get-os self ⇒ %return
Method: get-os self ⇒ %return

Gets the zlib-compressor:os property.

self

Passed: a <GZlibCompressor>.

a compressor

%return

Returned: a 32-bit integer.

the previously set OS value, or -1 if unset

Procedure: zlib-compressor:new format level ⇒ %return

Creates a compressor.

format

Passed: a <GZlibCompressorFormat>, or one of its symbols.

the format to use for the compressed data

level

Passed: a 32-bit integer.

compression level (0-9), -1 for default

%return

Returned: a <GZlibCompressor>.

a new <GZlibCompressor>

Method: zlib-compressor:set-file-info self [file-info]
Method: set-file-info self [file-info]

Sets the zlib-compressor: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 self, or after resetting it with converter:reset.

self

Passed: a <GZlibCompressor>.

a compressor

file-info

Passed, or left out: a <GFileInfo>, or #f.

file info for the gzip header

Method: zlib-compressor:set-os self os
Method: set-os self os

Sets the zlib-compressor: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 self, or after resetting it with converter:reset.

self

Passed: a <GZlibCompressor>.

a compressor

os

Passed: a 32-bit integer.

the OS code to use, or -1 to unset