Function

GLibVariantnew_string

Declaration

GVariant*
g_variant_new_string (
  const gchar* string
)

Description

Creates a string GVariant with the contents of string.

string must be valid UTF-8, and must not be NULL. To encode potentially-NULL strings, use g_variant_new() with ms as the [format string][gvariant-format-strings-maybe-types].

Available since:2.24

Parameters

string const gchar*
 

A normal UTF-8 nul-terminated string.

 The data is owned by the caller of the function.
 The string is a NUL terminated UTF-8 string.

Return value

Returns: GVariant
 

A floating reference to a new string GVariant instance.

 The data is owned by the called function.