Method

GLibVariantdup_bytestring

Declaration

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

Description

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

The return value must be freed using g_free().

Available since:2.26

Parameters

length

Type: gsize*

A pointer to a #gsize, to store the length (not including the nul terminator)

The argument will be set by the function.
The argument can be NULL.

Return value

Type: An array of guint8

     a newly allocated string.

The array is NULL-terminated.
The length of the array is in the length argument.
The caller of the method takes ownership of the data, and is responsible for freeing it.