Xmlb.ValueBindings¶
Fields¶
Name |
Type |
Access |
Description |
---|---|---|---|
dummy0 |
r |
||
dummy1 |
r |
||
dummy10 |
r |
||
dummy11 |
[ |
r |
|
dummy12 |
[ |
r |
|
dummy2 |
[ |
r |
|
dummy3 |
r |
||
dummy4 |
r |
||
dummy5 |
[ |
r |
|
dummy6 |
r |
||
dummy7 |
r |
||
dummy8 |
[ |
r |
|
dummy9 |
r |
Methods¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class Xmlb.ValueBindings¶
An opaque struct which contains values bound to a query.
New in version 0.3.0.
- bind_str(idx, str, destroy_func)¶
- Parameters:
idx (
int
) – 0-based index to bind tostr (
str
) – a string to bind to idxdestroy_func (
GLib.DestroyNotify
orNone
) – function to free str
Bind str to idx in the value bindings.
This will overwrite any previous binding at idx. It will take ownership of str, and an appropriate destroy_func must be provided to free str once the binding is no longer needed. destroy_func will be called exactly once at some point before the
Xmlb.ValueBindings
is cleared or freed.New in version 0.3.0.
- bind_val(idx, val)¶
-
Bind val to idx in the value bindings.
This will overwrite any previous binding at idx.
New in version 0.3.0.
- clear()¶
Clear an
Xmlb.ValueBindings
, freeing any allocated memory it points to.After this function has been called, the contents of the
Xmlb.ValueBindings
are undefined, and it’s only safe to callXmlb.ValueBindings.init
() on it.New in version 0.3.0.
- copy()¶
- Returns:
a copy of self
- Return type:
Copy self into a new heap-allocated
Xmlb.ValueBindings
instance.New in version 0.3.0.
- copy_binding(idx, dest, dest_idx)¶
- Parameters:
idx (
int
) – 0-based index to look up the binding from in selfdest (
Xmlb.ValueBindings
) – anXmlb.ValueBindings
to copy todest_idx (
int
) – 0-based index to copy the binding to in dest
- Returns:
- Return type:
Copies the value bound at idx on self to dest_idx on dest. If no value is bound at idx, dest is not modified and
False
is returned.dest must be initialised. If a binding already exists at dest_idx, it will be overwritten.
New in version 0.3.0.
- free()¶
Free a heap-allocated
Xmlb.ValueBindings
instance. This should be used onXmlb.ValueBindings
instances created withXmlb.ValueBindings.copy
().For stack-allocated instances,
Xmlb.ValueBindings.clear
() should be used instead.New in version 0.3.0.
- init()¶
Initialise a stack-allocated
Xmlb.ValueBindings
struct so it can be used.Stack-allocated
Xmlb.ValueBindings
instances should be freed once finished with, usingXmlb.ValueBindings.clear
() (org_auto(XbValueBindings)
, which is equivalent).New in version 0.3.0.
- is_bound(idx)¶
- Parameters:
idx (
int
) – 0-based index of the binding to check- Returns:
- Return type:
Check whether a value has been bound to the given index using (for example)
Xmlb.ValueBindings.bind_str
().New in version 0.3.0.
- lookup_opcode(idx)¶
- Parameters:
idx (
int
) – 0-based index to look up the binding from- Returns:
True
if idx was bound,False
otherwise- opcode_out:
pointer to an
Xmlb.Opcode
to initialise from the binding
- Return type:
(
bool
, opcode_out:Xmlb.Opcode
)
Initialises an
Xmlb.Opcode
with the value bound to idx, if a value is bound. If no value is bound, opcode_out is not touched andFalse
is returned.opcode_out is initialised to point to the data inside the
Xmlb.ValueBindings
, so must have a shorter lifetime than theXmlb.ValueBindings
. It will be of kindXmlb.OpcodeKind.BOUND_TEXT
orXmlb.OpcodeKind.BOUND_INTEGER
.New in version 0.3.0.