Variant.this
- this(GVariant* gVariant, bool ownedRef)
- this(VariantType childType, Variant[] children)
- this(bool value)
- this(char value)
- this(Variant key, Variant value)
- this(double value)
- this(VariantType elementType, void* elements, size_t nElements, size_t elementSize)
- this(VariantType type, Bytes bytes, bool trusted)
- this(VariantType type, ubyte[] data, bool trusted, GDestroyNotify notify, void* userData)
- this(short value)
- this(int value)
- this(long value)
- this(VariantType childType, Variant child)
- this(string format, void** app)
- this(string string_)
- this(string[] strv)
- this(Variant[] children)
- this(ushort value)
- this(uint value)
- this(ulong value)
- this(string formatString, string[] endptr, void** app)
- this(Variant value)
glib Variant Variant
aliasesconstructorsdestructorsfunctionsstatic functionsvariables
Creates a new #GVariant instance from serialised data.
@type is the type of #GVariant instance that will be constructed. The interpretation of @data depends on knowing the type.
@data is not modified by this function and must remain valid with an unchanging value until such a time as @notify is called with @user_data. If the contents of @data change before that time then the result is undefined.
If @data is trusted to be serialised data in normal form then @trusted should be %TRUE. This applies to serialised data created within this process or read from a trusted location on the disk (such as a file installed in /usr/lib alongside your application). You should set trusted to %FALSE if @data is read from the network, a file in the user's home directory, etc.
If @data was not stored in this machine's native endianness, any multi-byte numeric values in the returned variant will also be in non-native endianness. g_variant_byteswap() can be used to recover the original values.
@notify will be called with @user_data when @data is no longer needed. The exact time of this call is unspecified and might even be before this function returns.