Allows to get a cursor to iterate the hash in a linear and efficient way. The axlHashCursor could be used to iterate an axlHash in an efficient way because it stores current state (position), hiding all module details. Then using the following functions you can modify the state (current position to get):
Finally, the following functions are provided to get the data stored at a particular position, pointed by the current status of the cursor:
You are allowed to remove elements from the hash (axlHash) having a cursor created (axlHashCursor), using axl_hash_cursor_remove. Here is an example: axlPointer key; axlPointer value; axlHashCursor * cursor; // create the cursor cursor = axl_hash_cursor_new (hash); // while there are more elements while (axl_hash_cursor_has_item (cursor)) { // get the value and key value = axl_hash_cursor_get_key (cursor); value = axl_hash_cursor_get_value (cursor); // get the next axl_hash_cursor_next (cursor); } // free the cursor axl_hash_cursor_free (cursor);
|