Objectively 1.0.0
Ultra-lightweight object oriented framework for GNU C.
|
#include <Dictionary.h>
Immutable key-value stores.
Definition at line 60 of file Dictionary.h.
Properties | |
size_t | count |
The count of elements. More... | |
Object | object |
The superclass. More... | |
![]() | |
Class * | clazz |
Every instance of Object begins with a pointer to its Class. More... | |
Methods | |
Class * | _Dictionary (void) |
The Dictionary archetype. More... | |
Array * | allKeys (const Dictionary *self) |
Array * | allObjects (const Dictionary *self) |
_Bool | containsKey (const Dictionary *self, const ident key) |
_Bool | containsKeyPath (const Dictionary *self, const char *path) |
Dictionary * | dictionaryWithDictionary (const Dictionary *dictionary) |
Returns a new Dictionary containing all pairs from dictionary . More... | |
Dictionary * | dictionaryWithObjectsAndKeys (ident obj,...) |
Returns a new Dictionary containing pairs from the given arguments. More... | |
void | enumerateObjectsAndKeys (const Dictionary *self, DictionaryEnumerator enumerator, ident data) |
Enumerate the pairs of this Dictionary with the given function. More... | |
Dicionary * | filterObjectsAndKeys (const Dictionary *self, DictionaryPredicate predicate, ident data) |
Creates a new Dictionary with pairs that pass the filter function. More... | |
Dictionary * | initWithDictionary (Dictionary *self, const Dictionary *dictionary) |
Initializes this Dictionary to contain elements of dictionary . More... | |
Dictionary * | initWithObjectsAndKeys (Dictionary *self,...) |
Initializes this Dictionary with the NULL -terminated list of Objects and keys. More... | |
MutableDictionary * | mutableCopy (const Dictionary *self) |
ident | objectForKey (const Dictionary *self, const ident key) |
ident | objectForKeyPath (const Dictionary *self, const char *path) |
![]() | |
Class * | _Object (void) |
The Object archetype. More... | |
Object * | copy (const Object *self) |
Creates a shallow copy of this Object. More... | |
void | dealloc (Object *self) |
Frees all resources held by this Object. More... | |
String * | description (const Object *self) |
int | hash (const Object *self) |
Object * | init (Object *self) |
Initializes this Object. More... | |
_Bool | isEqual (const Object *self, const Object *other) |
Tests equality of the other Object. More... | |
_Bool | isKindOfClass (const Object *self, const Class *clazz) |
Tests for Class hierarchy membership. More... | |
Protected Attributes | |
DictionaryInterface * | interface |
The interface. More... | |
![]() | |
ObjectInterface * | interface |
The interface. More... | |
size_t Dictionary::count |
The count of elements.
Definition at line 82 of file Dictionary.h.
|
protected |
The interface.
Definition at line 71 of file Dictionary.h.
Object Dictionary::object |
The superclass.
Definition at line 65 of file Dictionary.h.
Class * _Dictionary | ( | void | ) |
The Dictionary archetype.
Definition at line 451 of file Dictionary.c.
Array * allKeys | ( | const Dictionary * | self | ) |
self | The Dictionary. |
Definition at line 169 of file Dictionary.c.
Array * allObjects | ( | const Dictionary * | self | ) |
self | The Dictionary. |
Definition at line 189 of file Dictionary.c.
_Bool containsKey | ( | const Dictionary * | self, |
const ident | key | ||
) |
self | The Dictionary. |
key | The key to test. |
Definition at line 202 of file Dictionary.c.
_Bool containsKeyPath | ( | const Dictionary * | self, |
const char * | path | ||
) |
self | The Dictionary. |
path | The key path to test. |
Definition at line 210 of file Dictionary.c.
Dictionary * dictionaryWithDictionary | ( | const Dictionary * | dictionary | ) |
Returns a new Dictionary containing all pairs from dictionary
.
dictionary | A Dictionary. |
NULL
on error. Definition at line 218 of file Dictionary.c.
Dictionary * dictionaryWithObjectsAndKeys | ( | ident | obj, |
... | |||
) |
Returns a new Dictionary containing pairs from the given arguments.
obj | The first in a NULL -terminated list of Objects and keys. |
NULL
on error. Definition at line 227 of file Dictionary.c.
void enumerateObjectsAndKeys | ( | const Dictionary * | self, |
DictionaryEnumerator | enumerator, | ||
ident | data | ||
) |
Enumerate the pairs of this Dictionary with the given function.
self | The Dictionary. |
enumerator | The enumerator function. |
data | User data. |
true
to break the iteration. Definition at line 253 of file Dictionary.c.
Dictionary * filterObjectsAndKeys | ( | const Dictionary * | self, |
DictionaryPredicate | predicate, | ||
ident | data | ||
) |
Creates a new Dictionary with pairs that pass the filter function.
self | The Dictionary. |
predicate | The predicate function. |
data | User data. |
Definition at line 278 of file Dictionary.c.
Dictionary * initWithDictionary | ( | Dictionary * | self, |
const Dictionary * | dictionary | ||
) |
Initializes this Dictionary to contain elements of dictionary
.
self | The Dictionary. |
dictionary | A Dictionary. |
NULL
on error. Definition at line 308 of file Dictionary.c.
Dictionary * initWithObjectsAndKeys | ( | Dictionary * | self, |
... | |||
) |
Initializes this Dictionary with the NULL
-terminated list of Objects and keys.
self | The Dictionary. |
NULL
on error. Definition at line 338 of file Dictionary.c.
MutableDictionary * mutableCopy | ( | const Dictionary * | self | ) |
self | The Dictionary. |
Definition at line 368 of file Dictionary.c.
ident objectForKey | ( | const Dictionary * | self, |
const ident | key | ||
) |
self | The Dictionary. |
key | The key. |
Definition at line 382 of file Dictionary.c.
ident objectForKeyPath | ( | const Dictionary * | self, |
const char * | path | ||
) |
self | The Dictionary. |
path | The key path. |
Definition at line 406 of file Dictionary.c.