Value

class Value(pointer: <Error class: unknown class><<Error class: unknown class>>, cleaner: <Error class: unknown class>? = null)

An opaque structure used to hold different types of values.

The data within the structure has protected scope: it is accessible only to functions within a #GTypeValueTable structure, or implementations of the g_value_*() API. That is, code portions which implement new fundamental types.

#GValue users cannot make any assumptions about how data is stored within the 2 element @data union, and the @g_type member should only be accessed through the G_VALUE_TYPE() macro.

Skipped during bindings generation

  • parameter transform_func: ValueTransform

  • field data: _Value__data__union

Constructors

Link copied to clipboard
constructor()

Allocate a new Value.

constructor(scope: <Error class: unknown class>)

Allocate a new Value using the provided AutofreeScope.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>, cleaner: <Error class: unknown class>? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val gobjectValuePointer: <Error class: unknown class><<Error class: unknown class>>

Functions

Link copied to clipboard
fun copy(destValue: Value)

Copies the value of @src_value into @dest_value.

Link copied to clipboard
fun dupBoxed(): <Error class: unknown class>?

Get the contents of a %G_TYPE_BOXED derived #GValue. Upon getting, the boxed value is duplicated and needs to be later freed with g_boxed_free(), e.g. like: g_boxed_free (G_VALUE_TYPE (@value), return_value);

Link copied to clipboard

Get the contents of a %G_TYPE_OBJECT derived #GValue, increasing its reference count. If the contents of the #GValue are null, then null will be returned.

Link copied to clipboard

Get the contents of a %G_TYPE_PARAM #GValue, increasing its reference count.

Link copied to clipboard

Get a copy the contents of a %G_TYPE_STRING #GValue.

Link copied to clipboard
fun dupVariant(): <Error class: unknown class>?

Get the contents of a variant #GValue, increasing its refcount. The returned #GVariant is never floating.

Link copied to clipboard

Determines if @value will fit inside the size of a pointer value. This is an internal function introduced mainly for C marshallers.

Link copied to clipboard

Get the contents of a %G_TYPE_BOOLEAN #GValue.

Link copied to clipboard
fun getBoxed(): <Error class: unknown class>?

Get the contents of a %G_TYPE_BOXED derived #GValue.

Link copied to clipboard
fun getChar(): Char

Do not use this function; it is broken on platforms where the %char type is unsigned, such as ARM and PowerPC. See g_value_get_schar().

Link copied to clipboard
fun getDouble(): <Error class: unknown class>

Get the contents of a %G_TYPE_DOUBLE #GValue.

Link copied to clipboard
fun getEnum(): <Error class: unknown class>

Get the contents of a %G_TYPE_ENUM #GValue.

Link copied to clipboard
fun getFlags(): <Error class: unknown class>

Get the contents of a %G_TYPE_FLAGS #GValue.

Link copied to clipboard
fun getFloat(): <Error class: unknown class>

Get the contents of a %G_TYPE_FLOAT #GValue.

Link copied to clipboard
fun getGtype(): <Error class: unknown class>

Get the contents of a %G_TYPE_GTYPE #GValue.

Link copied to clipboard
fun getInt(): <Error class: unknown class>

Get the contents of a %G_TYPE_INT #GValue.

Link copied to clipboard
fun getInt64(): <Error class: unknown class>

Get the contents of a %G_TYPE_INT64 #GValue.

Link copied to clipboard
fun getLong(): <Error class: unknown class>

Get the contents of a %G_TYPE_LONG #GValue.

Link copied to clipboard

Get the contents of a %G_TYPE_OBJECT derived #GValue.

Link copied to clipboard

Get the contents of a %G_TYPE_PARAM #GValue.

Link copied to clipboard
fun getPointer(): <Error class: unknown class>?

Get the contents of a pointer #GValue.

Link copied to clipboard
fun getSchar(): <Error class: unknown class>

Get the contents of a %G_TYPE_CHAR #GValue.

Link copied to clipboard

Get the contents of a %G_TYPE_STRING #GValue.

Link copied to clipboard
fun getUchar(): <Error class: unknown class>

Get the contents of a %G_TYPE_UCHAR #GValue.

Link copied to clipboard
fun getUint(): <Error class: unknown class>

Get the contents of a %G_TYPE_UINT #GValue.

Link copied to clipboard
fun getUint64(): <Error class: unknown class>

Get the contents of a %G_TYPE_UINT64 #GValue.

Link copied to clipboard
fun getUlong(): <Error class: unknown class>

Get the contents of a %G_TYPE_ULONG #GValue.

Link copied to clipboard
fun getVariant(): <Error class: unknown class>?

Get the contents of a variant #GValue.

Link copied to clipboard
fun init(gType: <Error class: unknown class>): Value

Initializes @value with the default value of @type.

Link copied to clipboard

Initializes and sets @value from an instantiatable type via the value_table's collect_value() function.

Link copied to clipboard
fun peekPointer(): <Error class: unknown class>?

Returns the value contents as pointer. This function asserts that g_value_fits_pointer() returned true for the passed in value. This is an internal function introduced mainly for C marshallers.

Link copied to clipboard
fun reset(): Value

Clears the current value in @value and resets it to the default value (as if the value had just been initialized).

Link copied to clipboard
fun setBoolean(vBoolean: Boolean)

Set the contents of a %G_TYPE_BOOLEAN #GValue to @v_boolean.

Link copied to clipboard
fun setBoxed(vBoxed: <Error class: unknown class>? = null)

Set the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed.

Link copied to clipboard
fun setBoxedTakeOwnership(vBoxed: <Error class: unknown class>? = null)

This is an internal function introduced mainly for C marshallers.

Link copied to clipboard
fun setChar(vChar: Char)

Set the contents of a %G_TYPE_CHAR #GValue to @v_char.

Link copied to clipboard
fun setDouble(vDouble: <Error class: unknown class>)

Set the contents of a %G_TYPE_DOUBLE #GValue to @v_double.

Link copied to clipboard
fun setEnum(vEnum: <Error class: unknown class>)

Set the contents of a %G_TYPE_ENUM #GValue to @v_enum.

Link copied to clipboard
fun setFlags(vFlags: <Error class: unknown class>)

Set the contents of a %G_TYPE_FLAGS #GValue to @v_flags.

Link copied to clipboard
fun setFloat(vFloat: <Error class: unknown class>)

Set the contents of a %G_TYPE_FLOAT #GValue to @v_float.

Link copied to clipboard
fun setGtype(vGtype: <Error class: unknown class>)

Set the contents of a %G_TYPE_GTYPE #GValue to @v_gtype.

Link copied to clipboard
fun setInstance(instance: <Error class: unknown class>? = null)

Sets @value from an instantiatable type via the value_table's collect_value() function.

Link copied to clipboard
fun setInt(vInt: <Error class: unknown class>)

Set the contents of a %G_TYPE_INT #GValue to @v_int.

Link copied to clipboard
fun setInt64(vInt64: <Error class: unknown class>)

Set the contents of a %G_TYPE_INT64 #GValue to @v_int64.

Link copied to clipboard
fun setInternedString(vString: String? = null)

Set the contents of a %G_TYPE_STRING #GValue to @v_string. The string is assumed to be static and interned (canonical, for example from g_intern_string()), and is thus not duplicated when setting the #GValue.

Link copied to clipboard
fun setLong(vLong: <Error class: unknown class>)

Set the contents of a %G_TYPE_LONG #GValue to @v_long.

Link copied to clipboard
fun setObject(vObject: Object? = null)

Set the contents of a %G_TYPE_OBJECT derived #GValue to @v_object.

Link copied to clipboard
fun setObjectTakeOwnership(vObject: <Error class: unknown class>? = null)

This is an internal function introduced mainly for C marshallers.

Link copied to clipboard
fun setParam(param: ParamSpec? = null)

Set the contents of a %G_TYPE_PARAM #GValue to @param.

Link copied to clipboard
fun setParamTakeOwnership(param: ParamSpec? = null)

This is an internal function introduced mainly for C marshallers.

Link copied to clipboard
fun setPointer(vPointer: <Error class: unknown class>? = null)

Set the contents of a pointer #GValue to @v_pointer.

Link copied to clipboard
fun setSchar(vChar: <Error class: unknown class>)

Set the contents of a %G_TYPE_CHAR #GValue to @v_char.

Link copied to clipboard
fun setStaticBoxed(vBoxed: <Error class: unknown class>? = null)

Set the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed.

Link copied to clipboard
fun setStaticString(vString: String? = null)

Set the contents of a %G_TYPE_STRING #GValue to @v_string. The string is assumed to be static, and is thus not duplicated when setting the #GValue.

Link copied to clipboard
fun setString(vString: String? = null)

Set the contents of a %G_TYPE_STRING #GValue to a copy of @v_string.

Link copied to clipboard
fun setUchar(vUchar: <Error class: unknown class>)

Set the contents of a %G_TYPE_UCHAR #GValue to @v_uchar.

Link copied to clipboard
fun setUint(vUint: <Error class: unknown class>)

Set the contents of a %G_TYPE_UINT #GValue to @v_uint.

Link copied to clipboard
fun setUint64(vUint64: <Error class: unknown class>)

Set the contents of a %G_TYPE_UINT64 #GValue to @v_uint64.

Link copied to clipboard
fun setUlong(vUlong: <Error class: unknown class>)

Set the contents of a %G_TYPE_ULONG #GValue to @v_ulong.

Link copied to clipboard
fun setVariant(variant: <Error class: unknown class>? = null)

Set the contents of a variant #GValue to @variant. If the variant is floating, it is consumed.

Link copied to clipboard

Steal ownership on contents of a %G_TYPE_STRING #GValue. As a result of this operation the value's contents will be reset to null.

Link copied to clipboard
fun takeBoxed(vBoxed: <Error class: unknown class>? = null)

Sets the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed and takes over the ownership of the caller’s reference to @v_boxed; the caller doesn’t have to unref it any more.

Link copied to clipboard
fun takeObject(vObject: <Error class: unknown class>? = null)

Sets the contents of a %G_TYPE_OBJECT derived #GValue to @v_object and takes over the ownership of the caller’s reference to @v_object; the caller doesn’t have to unref it any more (i.e. the reference count of the object is not increased).

Link copied to clipboard
fun takeParam(param: ParamSpec? = null)

Sets the contents of a %G_TYPE_PARAM #GValue to @param and takes over the ownership of the caller’s reference to @param; the caller doesn’t have to unref it any more.

Link copied to clipboard
fun takeVariant(variant: <Error class: unknown class>? = null)

Set the contents of a variant #GValue to @variant, and takes over the ownership of the caller's reference to @variant; the caller doesn't have to unref it any more (i.e. the reference count of the variant is not increased).

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun transform(destValue: Value): Boolean

Tries to cast the contents of @src_value into a type appropriate to store in @dest_value, e.g. to transform a %G_TYPE_INT value into a %G_TYPE_FLOAT value. Performing transformations between value types might incur precision lossage. Especially transformations into strings might reveal seemingly arbitrary results and shouldn't be relied upon for production code (such as rcfile value or object property serialization).

Link copied to clipboard
fun unset()

Clears the current value in @value (if any) and "unsets" the type, this releases all resources associated with this GValue. An unset value is the same as an uninitialized (zero-filled) #GValue structure.