Method

GLibVariantdup_string

Declaration

gchar*
g_variant_dup_string (
  GVariant* value,
  gsize* length
)

Description

Similar to g_variant_get_string() except that instead of returning a constant string, the string is duplicated.

The string will always be UTF-8 encoded.

The return value must be freed using g_free().

Available since:2.24

Parameters

length gsize*
 

A pointer to a #gsize, to store the length.

 The argument will be set by the function.

Return value

Returns: gchar*
 

A newly allocated string, UTF-8 encoded.

 The caller of the method takes ownership of the data, and is responsible for freeing it.
 The value is a NUL terminated UTF-8 string.