#include <stdbool.h>
Go to the source code of this file.
|
| struct | HashMap |
| | A hash map with strings for keys and any type for values doubles in size when the load factor is met, keeps KVPs as a linked list. More...
|
| |
| struct | HashmapKeyIterator |
| |
|
| void | HashmapInit (struct HashMap *pMap, int capacity, int valSize) |
| | initializes the hashmap struct to a decfault value. you can change fLoadFactor afterwards but it sets it to a default value
|
| |
| void | HashmapInitWithLoadFactor (struct HashMap *pMap, int capacity, int valSize, float loadFactor) |
| | same as HashmapInit but sets load factor as well
|
| |
| void * | HashmapSearch (struct HashMap *pMap, char *key) |
| | Search for a key in the hash map, returns a pointer to the value or NULL if not present.
|
| |
| void * | HashmapInsert (struct HashMap *pMap, char *key, void *pVal) |
| |
| bool | HashmapDeleteItem (struct HashMap *pMap, char *key) |
| |
| void | HashmapDeInit (struct HashMap *pMap) |
| |
| void | HashmapPrintEntries (struct HashMap *pMap, const char *hashMapName) |
| |
| struct HashmapKeyIterator | GetKeyIterator (struct HashMap *pHashMap) |
| | Get an iterator object that you can call "NextHashmapKey" with to iterate through the hashmaps keys.
|
| |
| char * | NextHashmapKey (struct HashmapKeyIterator *) |
| |
◆ GetKeyIterator()
Get an iterator object that you can call "NextHashmapKey" with to iterate through the hashmaps keys.
◆ HashmapDeInit()
| void HashmapDeInit |
( |
struct HashMap * |
pMap | ) |
|
◆ HashmapDeleteItem()
| bool HashmapDeleteItem |
( |
struct HashMap * |
pMap, |
|
|
char * |
key |
|
) |
| |
◆ HashmapInit()
| void HashmapInit |
( |
struct HashMap * |
pMap, |
|
|
int |
capacity, |
|
|
int |
valSize |
|
) |
| |
initializes the hashmap struct to a decfault value. you can change fLoadFactor afterwards but it sets it to a default value
- Parameters
-
| pMap | |
| capacity | |
| valSize | size of individual values |
◆ HashmapInitWithLoadFactor()
| void HashmapInitWithLoadFactor |
( |
struct HashMap * |
pMap, |
|
|
int |
capacity, |
|
|
int |
valSize, |
|
|
float |
loadFactor |
|
) |
| |
same as HashmapInit but sets load factor as well
- Parameters
-
| pMap | |
| capacity | |
| valSize | |
| loadFactor | size of individual values |
◆ HashmapInsert()
| void * HashmapInsert |
( |
struct HashMap * |
pMap, |
|
|
char * |
key, |
|
|
void * |
pVal |
|
) |
| |
- Parameters
-
- Returns
- true if a new key and inserted, false if an existing key and value overwritten
◆ HashmapPrintEntries()
| void HashmapPrintEntries |
( |
struct HashMap * |
pMap, |
|
|
const char * |
hashMapName |
|
) |
| |
◆ HashmapSearch()
| void * HashmapSearch |
( |
struct HashMap * |
pMap, |
|
|
char * |
key |
|
) |
| |
Search for a key in the hash map, returns a pointer to the value or NULL if not present.
- Parameters
-
- Returns
◆ NextHashmapKey()