get_string


Description:

public unowned string get_string (out size_t length = null)

Returns the string value of a Variant instance with a string type.

This includes the types g_variant_type_string, g_variant_type_object_path and g_variant_type_signature.

The string will always be utf8 encoded.

If length is non-null then the length of the string (in bytes) is returned there. For trusted values, this information is already known. For untrusted values, a size will be performed.

It is an error to call this function with a this of any type other than those three.

The return value remains valid as long as this exists.

Parameters:

this

a string Variant instance

length

a pointer to a size_t, to store the length

Returns:

the constant string, utf8 encoded