HashTableIter

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

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

Constructors

this
this(GHashTableIter* gHashTableIter, bool ownedRef)

Sets our main struct and passes it to the parent class.

Members

Functions

getHashTable
HashTable getHashTable()

Returns the glib.HashTable associated with iter.

getHashTableIterStruct
GHashTableIter* getHashTableIterStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

init
void init(HashTable hashTable)

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

next
bool next(void* key, void* value)

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.

remove
void remove()

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

replace
void replace(void* value)

Replaces the value currently pointed to by the iterator from its associated glib.HashTable Can only be called after HashTable.iterNext returned TRUE.

steal
void steal()

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

Variables

gHashTableIter
GHashTableIter* gHashTableIter;

the main Gtk struct