Variant

constructor(value: Boolean)(source)

Creates a new boolean #GVariant instance -- either true or false.

Return

a floating reference to a new boolean #GVariant instance

Since

2.24

Parameters

value

a #gboolean value


constructor(value: <Error class: unknown class>)(source)

Creates a new byte #GVariant instance.

Return

a floating reference to a new byte #GVariant instance

Since

2.24

Parameters

value

a #guint8 value


constructor(strv: List<String>, length: Long)(source)

Constructs an array of object paths #GVariant from the given array of strings.

Each string must be a valid #GVariant object path; see g_variant_is_object_path().

If @length is -1 then @strv is null-terminated.

Return

a new floating #GVariant instance

Since

2.30

Parameters

strv

an array of strings

length

the length of @strv, or -1


constructor(key: Variant, value: Variant)(source)

Creates a new dictionary entry #GVariant. @key and @value must be non-null. @key must be a value of a basic type (ie: not a container).

If the @key or @value are floating references (see g_variant_ref_sink()), the new instance takes ownership of them as if via g_variant_ref_sink().

Return

a floating reference to a new dictionary entry #GVariant

Since

2.24

Parameters

key

a basic #GVariant, the key

value

a #GVariant, the value


constructor(value: <Error class: unknown class>)(source)

Creates a new double #GVariant instance.

Return

a floating reference to a new double #GVariant instance

Since

2.24

Parameters

value

a #gdouble floating point value


constructor(    elementType: VariantType,     elements: <Error class: unknown class>? = null,     nElements: <Error class: unknown class>,     elementSize: <Error class: unknown class>)(source)

Constructs a new array #GVariant instance, where the elements are of @element_type type.

Return

a floating reference to a new array #GVariant instance

Since

2.32

Parameters

elementType

the #GVariantType of each element

elements

a pointer to the fixed array of contiguous elements

nElements

the number of elements

elementSize

the size of each element


constructor(type: VariantType, bytes: Bytes, trusted: Boolean)(source)

Constructs a new serialized-mode #GVariant instance. This is the inner interface for creation of new serialized values that gets called from various functions in gvariant.c.

A reference is taken on @bytes.

The data in @bytes must be aligned appropriately for the @type being loaded. Otherwise this function will internally create a copy of the memory (since GLib 2.60) or (in older versions) fail and exit the process.

Return

a new #GVariant with a floating reference

Since

2.36

Parameters

type

a #GVariantType

bytes

a #GBytes

trusted

if the contents of @bytes are trusted


constructor(value: <Error class: unknown class>)(source)

Creates a new int32 #GVariant instance.

Return

a floating reference to a new int32 #GVariant instance

Since

2.24

Parameters

value

a #gint32 value


constructor(value: Short)(source)

Creates a new int16 #GVariant instance.

Return

a floating reference to a new int16 #GVariant instance

Since

2.24

Parameters

value

a #gint16 value


constructor(value: <Error class: unknown class>)(source)

Creates a new int64 #GVariant instance.

Return

a floating reference to a new int64 #GVariant instance

Since

2.24

Parameters

value

a #gint64 value


constructor(childType: VariantType? = null, child: Variant? = null)(source)

Depending on if @child is null, either wraps @child inside of a maybe container or creates a Nothing instance for the given @type.

At least one of @child_type and @child must be non-null. If @child_type is non-null then it must be a definite type. If they are both non-null then @child_type must be the type of @child.

If @child is a floating reference (see g_variant_ref_sink()), the new instance takes ownership of @child.

Return

a floating reference to a new #GVariant maybe instance

Since

2.24

Parameters

childType

the #GVariantType of the child, or null

child

the child value, or null


constructor(string: String)(source)

Creates a string #GVariant with the contents of @string.

Return

a floating reference to a new string #GVariant instance

Since

2.24

Parameters

string

a normal UTF-8 nul-terminated string


constructor(value: <Error class: unknown class>)(source)

Creates a new uint16 #GVariant instance.

Return

a floating reference to a new uint16 #GVariant instance

Since

2.24

Parameters

value

a #guint16 value


constructor(value: <Error class: unknown class>)(source)

Creates a new uint32 #GVariant instance.

Return

a floating reference to a new uint32 #GVariant instance

Since

2.24

Parameters

value

a #guint32 value


constructor(value: <Error class: unknown class>)(source)

Creates a new uint64 #GVariant instance.

Return

a floating reference to a new uint64 #GVariant instance

Since

2.24

Parameters

value

a #guint64 value


constructor(value: Variant)(source)

Boxes @value. The result is a #GVariant instance representing a variant containing the original value.

If @child is a floating reference (see g_variant_ref_sink()), the new instance takes ownership of @child.

Return

a floating reference to a new variant #GVariant instance

Since

2.24

Parameters

value

a #GVariant instance


constructor(glibVariantPointer: <Error class: unknown class><<Error class: unknown class>>)(source)