public static Variant new_from_data<T> (VariantType type, uchar data, bool trusted, owned T owner = null)
Creates a new Variant instance from serialized data.
type is the type of Variant instance that will be constructed. The
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
user_data. If the contents of
data change before that time then the result is undefined.
data is trusted to be serialized data in normal form then
trusted should be true
. This applies to serialized 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.
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. byteswap can be used to recover the original values.
notify will be called with
data is no longer needed. The exact time of this call is
unspecified and might even be before this function returns.
data must be backed by memory that is 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.
a definite VariantType
the serialized data
function to call when
the size of
a new floating Variant of type