Variant.take_string


Description:

[ Version ( since = "2.38" ) ]
public Variant.take_string (owned string str)

Creates a string Variant with the contents of string.

string must be valid UTF-8, and must not be null. To encode potentially- null strings, use this with Variant.maybe.

After this call, string belongs to the Variant and may no longer be modified by the caller. The memory of data has to be dynamically allocated and will eventually be freed with g_free.

You must not modify or access string in any other way after passing it to this function. It is even possible that string is immediately freed.

Parameters:

string

a normal UTF-8 nul-terminated string

Returns:

a floating reference to a new string Variant instance