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.DestroyNotifyorNone) – 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.ValueBindingsis 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.ValueBindingsare 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.ValueBindingsinstance.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.ValueBindingsto 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
Falseis 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.ValueBindingsinstance. This should be used onXmlb.ValueBindingsinstances 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.ValueBindingsstruct so it can be used.Stack-allocated
Xmlb.ValueBindingsinstances 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:
Trueif idx was bound,Falseotherwise- opcode_out:
pointer to an
Xmlb.Opcodeto initialise from the binding
- Return type:
(
bool, opcode_out:Xmlb.Opcode)
Initialises an
Xmlb.Opcodewith the value bound to idx, if a value is bound. If no value is bound, opcode_out is not touched andFalseis 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_TEXTorXmlb.OpcodeKind.BOUND_INTEGER.New in version 0.3.0.