GCab.Cabinet

g GCab.Cabinet GCab.Cabinet GObject.Object GObject.Object GObject.Object->GCab.Cabinet

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

add_allowed_compression (compression)

add_folder (folder)

extract (path, file_callback, progress_callback, user_data, cancellable)

extract_simple (path, file_callback, user_data, cancellable)

get_folders ()

get_signature (cancellable)

get_size ()

load (stream, cancellable)

write (stream, file_callback, progress_callback, user_data, cancellable)

write_simple (stream, file_callback, user_data, cancellable)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

reserved

GLib.ByteArray

r/w

Reserved

signature

GLib.ByteArray

r/w

Signature

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class GCab.Cabinet(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

GCab.CabinetClass

An opaque object holding a Cabinet file reference.

classmethod new()
Returns:

a new GCab.Cabinet

Return type:

GCab.Cabinet

Create a new GCab.Cabinet object to read or create a Cabinet archive.

add_allowed_compression(compression)
Parameters:

compression (GCab.Compression) – a GCab.Compression kind, e.g. GCab.Compression.MSZIP

Adds a compression kind to the allow-list. By default, GCab will use all decompression support compiled in at build time. Once this function has been called only specific compression kinds will be used in functions like GCab.Cabinet.load().

New in version 1.6.

add_folder(folder)
Parameters:

folder (GCab.Folder) – a GCab.Folder

Raises:

GLib.Error

Returns:

True on success.

Return type:

bool

Add folder to self.

extract(path, file_callback, progress_callback, user_data, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success.

Return type:

bool

Extract files to given path.

If path is None then the files are decompressed to memory blobs stored on each GCab.File.

extract_simple(path, file_callback, user_data, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success.

Return type:

bool

Extract files to given path.

get_folders()
Returns:

an array of GCab.Folder

Return type:

[GCab.Folder]

Get the Cabinet folders within the self. Note that Cabinet folders are not like filesystem path, they are group of files sharing some layout parameters.

get_signature(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – optional Gio.Cancellable object, None to ignore

Raises:

GLib.Error

Returns:

the array containing the PKCS#7 signed data or None on error.

Return type:

bytes

Lookup the cabinet authenticode signature if any.

New in version 0.5.

get_size()
Returns:

size in bytes

Return type:

int

Get the size of the compressed cabinet file.

New in version 1.0.

load(stream, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success

Return type:

bool

Load a cabinet archive.

write(stream, file_callback, progress_callback, user_data, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success.

Return type:

bool

Save self to the output stream out. out must be a Gio.Seekable.

write_simple(stream, file_callback, user_data, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success.

Return type:

bool

Save self to the output stream out. out must be a Gio.Seekable.

Property Details

GCab.Cabinet.props.reserved
Name:

reserved

Type:

GLib.ByteArray

Default Value:

None

Flags:

READABLE, WRITABLE

Reserved

GCab.Cabinet.props.signature
Name:

signature

Type:

GLib.ByteArray

Default Value:

None

Flags:

READABLE, WRITABLE

Signature