A list of objects.
More...
#include <ircbot/list.h>
◆ IBList_append()
| void IBList_append |
( |
IBList * |
self, |
|
|
void * |
obj, |
|
|
void(*)(void *) |
deleter |
|
) |
| |
Append an object to the list.
- Parameters
-
| self | the IBList |
| obj | the new object |
| deleter | optional function to destroy the object |
◆ IBList_at()
| void * IBList_at |
( |
const IBList * |
self, |
|
|
size_t |
idx |
|
) |
| |
Gets an object by position.
- Parameters
-
| self | the IBList |
| idx | position of the object |
- Returns
- the object stored at that position, or NULL
◆ IBList_create()
| IBList * IBList_create |
( |
void |
| ) |
|
◆ IBList_destroy()
| void IBList_destroy |
( |
IBList * |
self | ) |
|
IBList destructor.
All stored objects that have a deleter attached are destroyed as well.
- Parameters
-
◆ IBList_fromString()
| IBList * IBList_fromString |
( |
const char * |
str, |
|
|
const char * |
delim |
|
) |
| |
Create a List of strings by splitting a given string.
The string is split at any of the characters given in delim. Empty fields are ignored.
- Parameters
-
| str | the string to split |
| delim | characters that are considered delimiting fields |
- Returns
- a list of strings, or NULL if no non-empty fields were found
◆ IBList_iterator()
Creates an iterator for all entries.
The iterator contains a snapshot of all objects currently stored, modifications to the IBList will not be reflected in the iterator. In its initial state, the iterator points to an invalid position.
- Parameters
-
- Returns
- an iterator
◆ IBList_remove()
| void IBList_remove |
( |
IBList * |
self, |
|
|
void * |
obj |
|
) |
| |
Remove a given object from the list.
The object will not be automatically destroyed.
- Parameters
-
| self | the IBList |
| obj | the object to remove |
◆ IBList_removeAll()
| void IBList_removeAll |
( |
IBList * |
self, |
|
|
int(*)(void *, const void *) |
matcher, |
|
|
const void * |
arg |
|
) |
| |
Remove matching objects from the list.
Objects that are removed will be destroyed if they have a deleter attached.
- Parameters
-
| self | the IBList |
| matcher | function to compare each object to some specified value, must return 1 to have that object removed, 0 otherwise |
| arg | some value for the matcher function to compare the objects against. |
◆ IBList_size()
| size_t IBList_size |
( |
const IBList * |
self | ) |
|
Number of entries.
- Parameters
-
- Returns
- the number of entries
The documentation for this class was generated from the following file: