Struct

GLibHashTableIter

Description

struct GHashTableIter {
  /* No available fields */
}

A GHashTableIter structure represents an iterator that can be used to iterate over the elements of a GHashTable. GHashTableIter structures are typically allocated on the stack and then initialized with g_hash_table_iter_init().

The iteration order of a GHashTableIter over the keys/values in a hash table is not defined.

Instance methods

g_hash_table_iter_get_hash_table

Returns the GHashTable associated with iter.

since: 2.16

g_hash_table_iter_init

Initializes a key/value pair iterator and associates it with hash_table. Modifying the hash table after calling this function invalidates the returned iterator.

since: 2.16

g_hash_table_iter_next

Advances iter and retrieves the key and/or value that are now pointed to as a result of this advancement. If FALSE is returned, key and value are not set, and the iterator becomes invalid.

since: 2.16

g_hash_table_iter_remove

Removes the key/value pair currently pointed to by the iterator from its associated GHashTable. Can only be called after g_hash_table_iter_next() returned TRUE, and cannot be called more than once for the same key/value pair.

since: 2.16

g_hash_table_iter_replace

Replaces the value currently pointed to by the iterator from its associated GHashTable. Can only be called after g_hash_table_iter_next() returned TRUE.

since: 2.30

g_hash_table_iter_steal

Removes the key/value pair currently pointed to by the iterator from its associated GHashTable, without calling the key and value destroy functions. Can only be called after g_hash_table_iter_next() returned TRUE, and cannot be called more than once for the same key/value pair.

since: 2.16