Xmlb.Builder¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Xmlb.Builder(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
- Returns:
a new
Xmlb.Builder
- Return type:
Creates a new builder.
The
Xmlb.Silo
returned by the methods of thisXmlb.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
) – aXmlb.BuilderFixup
Adds a function that will get run on every
Xmlb.BuilderNode
compile creates for the silo. This is run after all theXmlb.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:
flags (
Xmlb.BuilderCompileFlags
) – someXmlb.BuilderCompileFlags
, e.g.Xmlb.BuilderSourceFlags.LITERAL_TEXT
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
- Raises:
- Returns:
- Return type:
Compiles a
Xmlb.Silo
.New in version 0.1.0.
- ensure(file, flags, cancellable)¶
- Parameters:
flags (
Xmlb.BuilderCompileFlags
) – someXmlb.BuilderCompileFlags
, e.g.Xmlb.BuilderCompileFlags.IGNORE_INVALID
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
- Raises:
- Returns:
- Return type:
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
) – aXmlb.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
) – aXmlb.BuilderSource
Adds a
Xmlb.BuilderSource
to theXmlb.Builder
.New in version 0.1.0.
- set_profile_flags(profile_flags)¶
- Parameters:
profile_flags (
Xmlb.SiloProfileFlags
) – someXmlb.SiloProfileFlags
, e.g.Xmlb.SiloProfileFlags.DEBUG
Enables or disables the collection of profiling data.
New in version 0.1.1.