:right-sidebar: True ZlibCompressor =================================================================== .. currentmodule:: gi.repository.Gio .. class:: ZlibCompressor(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gio.Converter` ``GZlibCompressor`` is an implementation of :obj:`~gi.repository.Gio.Converter` that compresses data using zlib. Constructors ------------ .. rst-class:: interim-class .. class:: ZlibCompressor :no-index: .. classmethod:: new(format: ~gi.repository.Gio.ZlibCompressorFormat, level: int) -> ~gi.repository.Gio.ZlibCompressor Creates a compressor. .. versionadded:: 2.24 :param format: the format to use for the compressed data :param level: compression level (``0``\-``9``\), ``-1`` for default Methods ------- .. rst-class:: interim-class .. class:: ZlibCompressor :no-index: .. method:: get_file_info() -> ~gi.repository.Gio.FileInfo | None Gets the :obj:`~gi.repository.Gio.ZlibCompressor.props.file_info` property. .. versionadded:: 2.26 .. method:: get_os() -> int Gets the :obj:`~gi.repository.Gio.ZlibCompressor.props.os` property. .. versionadded:: 2.86 .. method:: set_file_info(file_info: ~gi.repository.Gio.FileInfo | None = None) -> None Sets the :obj:`~gi.repository.Gio.ZlibCompressor.props.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 :obj:`~gi.repository.Gio.Converter.reset`\. .. versionadded:: 2.26 :param file_info: file info for the gzip header .. method:: set_os(os: int) -> None Sets the :obj:`~gi.repository.Gio.ZlibCompressor.props.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 :obj:`~gi.repository.Gio.Converter.reset`\. .. versionadded:: 2.86 :param os: the OS code to use, or ``-1`` to unset Properties ---------- .. rst-class:: interim-class .. class:: ZlibCompressor :no-index: .. attribute:: props.file_info :type: ~gi.repository.Gio.FileInfo A :obj:`~gi.repository.Gio.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 :obj:`~gi.repository.Gio.ZlibCompressor.props.format` is :obj:`~gi.repository.Gio.ZlibCompressorFormat.GZIP`\. .. versionadded:: 2.26 .. attribute:: props.format :type: ~gi.repository.Gio.ZlibCompressorFormat The format of the compressed data. .. versionadded:: 2.24 .. attribute:: props.level :type: int The level of compression from ``0`` (no compression) to ``9`` (most compression). ``-1`` for the default level. .. versionadded:: 2.24 .. attribute:: props.os :type: int The OS code of the gzip header. This will be used if set to a non-negative value, and if :obj:`~gi.repository.Gio.ZlibCompressor.props.format` is :obj:`~gi.repository.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. .. versionadded:: 2.86