Method

GLibKeyFileload_from_data

Declaration

gboolean
g_key_file_load_from_data (
  GKeyFile* key_file,
  const gchar* data,
  gsize length,
  GKeyFileFlags flags,
  GError** error
)

Description

Loads a key file from memory into an empty GKeyFile structure. If the object cannot be created then %error is set to a GKeyFileError.

Available since:2.6

Parameters

data const gchar*
 

Key file loaded in memory.

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

The length of data in bytes (or (gsize)-1 if data is nul-terminated)

flags GKeyFileFlags
 

Flags from GKeyFileFlags.

error GError **
  The return location for a GError*, or NULL.

Return value

Returns: gboolean
 

TRUE if a key file could be loaded, FALSE otherwise.