GCabFolder

GCabFolder — A Cabinet folder

Stability Level

Stable, unless otherwise indicated

Synopsis

#include <libgcab.h>

enum                GCabCompression;
                    GCabFolder;
GCabFolder *        gcab_folder_new                     (gint comptype);
gboolean            gcab_folder_add_file                (GCabFolder *cabfolder,
                                                         GCabFile *cabfile,
                                                         gboolean recurse,
                                                         GCancellable *cancellable,
                                                         GError **error);
GSList *            gcab_folder_get_files               (GCabFolder *cabfolder);
guint               gcab_folder_get_nfiles              (GCabFolder *cabfolder);

Object Hierarchy

  GEnum
   +----GCabCompression
  GObject
   +----GCabFolder

Properties

  "compression"              GCabCompression       : Read
  "comptype"                 gint                  : Read / Write / Construct Only
  "reserved"                 GByteArray*           : Read / Write

Description

A GCabFolder is a handle to a folder within the Cabinet archive. A Cabinet folder is not like a directory. It is a sub-container grouping GCabFiles together, sharing some common settings like the compression method.

You can retrieve the files withing a folder with gcab_folder_get_files().

In order to add a file to a folder for creation, use gcab_folder_add_file().

Details

enum GCabCompression

typedef enum {
    GCAB_COMPRESSION_NONE = 0,
    GCAB_COMPRESSION_MSZIP = 1,
    GCAB_COMPRESSION_QUANTUM = 2,
    GCAB_COMPRESSION_LZX = 3,

    GCAB_COMPRESSION_MASK = 0xf,
} GCabCompression;

Compression used by the GCabFolder.

GCAB_COMPRESSION_NONE

No compression.

GCAB_COMPRESSION_MSZIP

MSZIP compression.

GCAB_COMPRESSION_QUANTUM

QUANTUM compression.

GCAB_COMPRESSION_LZX

LZX compression.

GCAB_COMPRESSION_MASK

compression value mask.

GCabFolder

typedef struct _GCabFolder GCabFolder;

An opaque object, referencing a folder in a Cabinet.


gcab_folder_new ()

GCabFolder *        gcab_folder_new                     (gint comptype);

Creates a new empty Cabinet folder. Use gcab_folder_add_file() to add files to an archive.

A Cabinet folder is not a file path, it is a container for files.

comptype :

compression to used in this folder

Returns :

a new GCabFolder

gcab_folder_add_file ()

gboolean            gcab_folder_add_file                (GCabFolder *cabfolder,
                                                         GCabFile *cabfile,
                                                         gboolean recurse,
                                                         GCancellable *cancellable,
                                                         GError **error);

Add file to the GCabFolder.

cabfolder :

a GCabFolder

cabfile :

file to be added

recurse :

whether to recurse through subdirectories

cancellable :

optional GCancellable object, NULL to ignore. [allow-none]

error :

GError to set on error, or NULL. [allow-none]

Returns :

TRUE on succes

gcab_folder_get_files ()

GSList *            gcab_folder_get_files               (GCabFolder *cabfolder);

Get the list of GCabFile files contained in the cabfolder.

cabfolder :

a GCabFolder

Returns :

list of files. [element-type GCabFile][transfer full]

gcab_folder_get_nfiles ()

guint               gcab_folder_get_nfiles              (GCabFolder *cabfolder);

Get the number of files in this folder.

cabfolder :

a GCabFolder

Returns :

a guint

Property Details

The "compression" property

  "compression"              GCabCompression       : Read

compression.

Default value: GCAB_COMPRESSION_NONE


The "comptype" property

  "comptype"                 gint                  : Read / Write / Construct Only

comptype.

Allowed values: >= 0

Default value: 0


The "reserved" property

  "reserved"                 GByteArray*           : Read / Write

Reserved.

See Also

GCabFolder