Jcat.File

g GObject.Object GObject.Object Jcat.File Jcat.File GObject.Object->Jcat.File

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

add_item (item)

export_file (gfile, flags, cancellable)

export_json (flags)

export_stream (ostream, flags, cancellable)

get_item_by_id (id)

get_item_default ()

get_items ()

get_version_major ()

get_version_minor ()

import_file (gfile, flags, cancellable)

import_json (json, flags)

import_stream (istream, flags, cancellable)

to_string ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Jcat.File(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Jcat.FileClass

classmethod new()
Returns:

a Jcat.File

Return type:

Jcat.File

Creates a new file.

New in version 0.1.0.

add_item(item)
Parameters:

item (Jcat.Item) – Jcat.Item

Adds an item to a file.

New in version 0.1.0.

export_file(gfile, flags, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Exports a Jcat file to a compressed file.

New in version 0.1.0.

export_json(flags)
Parameters:

flags (Jcat.ExportFlags) – a Jcat.ExportFlags, typically Jcat.ExportFlags.NONE

Raises:

GLib.Error

Returns:

JSON output, or None for error

Return type:

str

Exports a Jcat file to raw JSON.

New in version 0.1.0.

export_stream(ostream, flags, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Exports a Jcat file to a compressed stream.

New in version 0.1.0.

get_item_by_id(id)
Parameters:

id (str) – An ID, typically a filename basename

Raises:

GLib.Error

Returns:

a Jcat.Item, or None if the filename was not found

Return type:

Jcat.Item

Finds the item with the specified ID, falling back to the ID alias if set.

New in version 0.1.0.

get_item_default()
Raises:

GLib.Error

Returns:

a Jcat.Item, or None if no default exists

Return type:

Jcat.Item

Finds the default item. If more than one Jcat.Item exists this function will return with an error.

New in version 0.1.0.

get_items()
Returns:

all the items in the file

Return type:

[Jcat.Item]

Returns all the items in the file.

New in version 0.1.0.

get_version_major()
Returns:

integer

Return type:

int

Returns the major version number of the Jcat specification

New in version 0.1.0.

get_version_minor()
Returns:

integer

Return type:

int

Returns the minor version number of the Jcat specification

New in version 0.1.0.

import_file(gfile, flags, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Imports a compressed Jcat file from an input stream.

New in version 0.1.0.

import_json(json, flags)
Parameters:
Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Imports a Jcat file from raw JSON.

New in version 0.1.0.

import_stream(istream, flags, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Imports a compressed Jcat file from a file.

New in version 0.1.0.

to_string()
Returns:

string

Return type:

str

Converts the Jcat.File to a string.

New in version 0.1.0.