Zip files: GSF Reference Manual

## Zip files Zip files — Utilities for reading and writing ZIP/JAR files |

## Functions

GsfInfile * | gsf_infile_zip_new ()
GsfOutfile * | gsf_outfile_zip_new ()
gboolean | gsf_outfile_zip_set_compression_method ()

## Properties

int | compression-level | Read
GsfInfileZip * | internal-parent | Write / Construct Only
GsfInput * | source | Read / Write / Construct Only
gboolean | zip64 | Read
int | compression-level | Read / Write / Construct Only
int | deflate-level | Read / Write / Construct Only
char * | entry-name | Read / Write / Construct Only
GsfOutput * | sink | Read / Write / Construct Only
int | zip64 | Read / Write / Construct Only

## Types and Values

| GsfInfileZip
| GsfOutfileZip

## Object Hierarchy

        GObject
        ├── GsfInput
        │   ╰── GsfInfile
        │       ╰── GsfInfileZip
        ╰── GsfOutput
            ╰── GsfOutfile
                ╰── GsfOutfileZip

## Description

GsfInfile and GsfOutfile support for zip files.

## Functions

### gsf_infile_zip_new ()

    GsfInfile *
    gsf_infile_zip_new (GsfInput *source,
                        GError **err);

Opens the root directory of a Zip file.

This adds a reference to `source`.

#### Parameters

source | A base GsfInput |
err | place to store a GError if anything goes wrong. | [out][optional][nullable]

#### Returns

the new zip file handler

### gsf_outfile_zip_new ()

    GsfOutfile *
    gsf_outfile_zip_new (GsfOutput *sink,
                         GError **err);

Creates the root directory of a Zip file and manages the addition of children.

This adds a reference to `sink`.

#### Parameters

sink | a GsfOutput to hold the ZIP file |
err | place to store a GError if anything goes wrong. | [out][optional][nullable]

#### Returns

the new zip file handler

### gsf_outfile_zip_set_compression_method ()

    gboolean
    gsf_outfile_zip_set_compression_method
                                   (GsfOutfileZip *zip,
                                    GsfZipCompressionMethod method);

## Types and Values

### GsfInfileZip

    typedef struct _GsfInfileZip GsfInfileZip;

### GsfOutfileZip

    typedef struct _GsfOutfileZip GsfOutfileZip;

## Property Details

### The `“compression-level”` property

      “compression-level”        int

Controls the level of compression used for new members.

Owner: GsfInfileZip

Flags: Read

Allowed values: [0,10]

Default value: 0

### The `“internal-parent”` property

      “internal-parent”          GsfInfileZip *

Internal use only.

Owner: GsfInfileZip

Flags: Write / Construct Only

### The `“source”` property

      “source”                   GsfInput *

The archive being interpreted.

Owner: GsfInfileZip

Flags: Read / Write / Construct Only

### The `“zip64”` property

      “zip64”                    gboolean

Whether zip64 is being used.

Owner: GsfInfileZip

Flags: Read

Default value: FALSE

### The `“compression-level”` property

      “compression-level”        int

The level of compression used, zero meaning none.

Owner: GsfOutfileZip

Flags: Read / Write / Construct Only

Allowed values: [0,10]

Default value: 8

### The `“deflate-level”` property

      “deflate-level”            int

The level of deflate compression used, zero meaning none and -1 meaning the zlib default.

Owner: GsfOutfileZip

Flags: Read / Write / Construct Only

Allowed values: [-1,9]

Default value: -1

### The `“entry-name”` property

      “entry-name”               char *

The filename of this member in the archive without path.

Owner: GsfOutfileZip

Flags: Read / Write / Construct Only

Default value: NULL

### The `“sink”` property

      “sink”                     GsfOutput *

Where the archive is written.

Owner: GsfOutfileZip

Flags: Read / Write / Construct Only

### The `“zip64”` property

      “zip64”                    int

Whether to use zip64 format, -1 meaning automatic.

Owner: GsfOutfileZip

Flags: Read / Write / Construct Only

Allowed values: [-1,1]

Default value: -1