Xmlb.Builder

g GObject.Object GObject.Object Xmlb.Builder Xmlb.Builder GObject.Object->Xmlb.Builder

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

add_fixup (fixup)

add_locale (locale)

append_guid (guid)

compile (flags, cancellable)

ensure (file, flags, cancellable)

import_node (bn)

import_source (source)

set_profile_flags (profile_flags)

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 Xmlb.Builder(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Xmlb.BuilderClass

classmethod new()
Returns:

a new Xmlb.Builder

Return type:

Xmlb.Builder

Creates a new builder.

The Xmlb.Silo returned by the methods of this Xmlb.Builder will use the thread-default main context at the time of calling this function for its future signal emissions.

New in version 0.1.0.

add_fixup(fixup)
Parameters:

fixup (Xmlb.BuilderFixup) – a Xmlb.BuilderFixup

Adds a function that will get run on every Xmlb.BuilderNode compile creates for the silo. This is run after all the Xmlb.BuilderSource fixups have been run.

New in version 0.1.3.

add_locale(locale)
Parameters:

locale (str) – a locale, e.g. “en_US”

Adds a locale to the builder. Locales added first will be prioritised over locales added later.

New in version 0.1.0.

append_guid(guid)
Parameters:

guid (str) – any text, typcically a filename or GUID

Adds the GUID to the internal correctness hash.

New in version 0.1.0.

compile(flags, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a Xmlb.Silo, or None for error

Return type:

Xmlb.Silo

Compiles a Xmlb.Silo.

New in version 0.1.0.

ensure(file, flags, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a Xmlb.Silo, or None for error

Return type:

Xmlb.Silo

Ensures file is up to date, and returns a compiled Xmlb.Silo.

If silo is being used by a query (e.g. in another thread) then all node data is immediately invalid.

The returned Xmlb.Silo will use the thread-default main context at the time of calling this function for its future signal emissions.

New in version 0.1.0.

import_node(bn)
Parameters:

bn (Xmlb.BuilderNode) – a Xmlb.BuilderNode

Adds a node tree to the builder.

If you are manually adding dynamic data sourced from a non-static source then you MUST use Xmlb.Builder.append_guid() with the appropriate GUID value, e.g. the file name and mtime.

If no appropriate value is available, the caller can use something like:

g_autofree str *tmp = Xmlb.BuilderNode.export(bn, Xmlb.NodeExportFlags.NONE, None); Xmlb.Builder.append_guid(builder, tmp);

Failure to include an appropriate GUID value would allow an out-of-data silo to be used.

New in version 0.1.0.

import_source(source)
Parameters:

source (Xmlb.BuilderSource) – a Xmlb.BuilderSource

Adds a Xmlb.BuilderSource to the Xmlb.Builder.

New in version 0.1.0.

set_profile_flags(profile_flags)
Parameters:

profile_flags (Xmlb.SiloProfileFlags) – some Xmlb.SiloProfileFlags, e.g. Xmlb.SiloProfileFlags.DEBUG

Enables or disables the collection of profiling data.

New in version 0.1.1.