Method

GLibKeyFilehas_key

Declaration

gboolean
g_key_file_has_key (
  GKeyFile* key_file,
  const gchar* group_name,
  const gchar* key,
  GError** error
)

Description

Looks whether the key file has the key key in the group group_name.

Note that this function does not follow the rules for GError strictly; the return value both carries meaning and signals an error. To use this function, you must pass a GError pointer in error, and check whether it is not NULL to see if an error occurred.

Language bindings should use g_key_file_get_value() to test whether or not a key exists.

Available since:2.6

Parameters

group_name const gchar*
 

A group name.

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

A key name.

 The data is owned by the caller of the function.
 The string is a NUL terminated UTF-8 string.
error GError **
  The return location for a GError*, or NULL.

Return value

Returns: gboolean
 

TRUE if key is a part of group_name, FALSE otherwise.