|
Objectively
Ultra-lightweight object oriented framework for GNU C.
|
#include <Dictionary.h>
Key-value stores.
Definition at line 60 of file Dictionary.h.
Properties | |
| size_t | count |
| The count of elements. | |
| Object | object |
| The superclass. | |
Properties inherited from Object | |
| Class * | clazz |
| Every instance of Object begins with a pointer to its Class. | |
| unsigned int | magic |
| A header to allow introspection of Object types. | |
Methods | |
| Class * | _Dictionary (void) |
| The Dictionary archetype. | |
| void | addEntriesFromDictionary (Dictionary *self, const Dictionary *dictionary) |
Adds the key-value entries from dictionary to this Dictionary. | |
| 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 * | dictionary (void) |
| Returns a new Dictionary. | |
| Dictionary * | dictionaryWithCapacity (size_t capacity) |
Returns a new Dictionary with the given capacity. | |
| Dictionary * | dictionaryWithDictionary (const Dictionary *dictionary) |
Returns a new Dictionary containing all pairs from dictionary. | |
| Dictionary * | dictionaryWithObjectsAndKeys (ident obj,...) |
| Returns a new Dictionary containing pairs from the given arguments. | |
| void | enumerateObjectsAndKeys (const Dictionary *self, DictionaryEnumerator enumerator, ident data) |
| Enumerate the pairs of this Dictionary with the given function. | |
| Dicionary * | filterObjectsAndKeys (const Dictionary *self, DictionaryPredicate predicate, ident data) |
| Creates a new Dictionary with pairs that pass the filter function. | |
| Dictionary * | init (Dictionary *self) |
| Initializes this Dictionary. | |
| Dictionary * | initWithCapacity (Dictionary *self, size_t capacity) |
| Initializes this Dictionary with the specified capacity. | |
| Dictionary * | initWithDictionary (Dictionary *self, const Dictionary *dictionary) |
Initializes this Dictionary to contain elements of dictionary. | |
| Dictionary * | initWithObjectsAndKeys (Dictionary *self,...) |
Initializes this Dictionary with the NULL-terminated list of Objects and keys. | |
| ident | objectForKey (const Dictionary *self, const ident key) |
| ident | objectForKeyPath (const Dictionary *self, const char *path) |
| ident | objectForKeyPathWithClass (const Dictionary *self, const char *path, const Class *clazz) |
| void | removeAllObjects (Dictionary *self) |
| Removes all Objects from this Dictionary. | |
| void | removeAllObjectsWithEnumerator (Dictionary *self, DictionaryEnumerator enumerator, ident data) |
Removes all Objects from this Dictionary, invoking enumerator for each Object and key pair. | |
| void | removeObjectForKey (Dictionary *self, const ident key) |
| Removes the Object with the specified key from this Dictionary. | |
| void | removeObjectForKeyPath (Dictionary *self, const char *path) |
| Removes the Object with the specified key path from this Dictionary. | |
| void | setObjectForKey (Dictionary *self, const ident obj, const ident key) |
| Sets a pair in this Dictionary. | |
| void | setObjectForKeyPath (Dictionary *self, const ident obj, const char *path) |
| Sets a pair in this Dictionary. | |
| void | setObjectsForKeyPaths (Dictionary *self,...) |
| Sets pairs in this Dictionary from the NULL-terminated list. | |
| void | setObjectsForKeys (Dictionary *self,...) |
| Sets pairs in this Dictionary from the NULL-terminated list. | |
Methods inherited from Object | |
| Class * | _Object (void) |
| The Object archetype. | |
| Object * | copy (const Object *self) |
| Creates a shallow copy of this Object. | |
| void | dealloc (Object *self) |
| Frees all resources held by this Object. | |
| String * | description (const Object *self) |
| int | hash (const Object *self) |
| Object * | init (Object *self) |
| Initializes this Object. | |
| bool | isEqual (const Object *self, const Object *other) |
| Tests equality of the other Object. | |
| bool | isKindOfClass (const Object *self, const Class *clazz) |
| Tests for Class hierarchy membership. | |
Protected Attributes | |
| DictionaryInterface * | interface |
| The interface. | |
Protected Attributes inherited from Object | |
| ObjectInterface * | interface |
| The interface. | |
| 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 762 of file Dictionary.c.
| void addEntriesFromDictionary | ( | Dictionary * | self, |
| const Dictionary * | dictionary | ||
| ) |
Adds the key-value entries from dictionary to this Dictionary.
| self | The Dictionary. |
| dictionary | A Dictionary. |
Definition at line 175 of file Dictionary.c.
| Array * allKeys | ( | const Dictionary * | self | ) |
| self | The Dictionary. |
Definition at line 193 of file Dictionary.c.
| Array * allObjects | ( | const Dictionary * | self | ) |
| self | The Dictionary. |
Definition at line 213 of file Dictionary.c.
| bool containsKey | ( | const Dictionary * | self, |
| const ident | key | ||
| ) |
| self | The Dictionary. |
| key | The key to test. |
Definition at line 226 of file Dictionary.c.
| bool containsKeyPath | ( | const Dictionary * | self, |
| const char * | path | ||
| ) |
| self | The Dictionary. |
| path | The key path to test. |
Definition at line 234 of file Dictionary.c.
| Dictionary * dictionary | ( | void | ) |
Returns a new Dictionary.
NULL on error. Definition at line 242 of file Dictionary.c.
| Dictionary * dictionaryWithCapacity | ( | size_t | capacity | ) |
Returns a new Dictionary with the given capacity.
| capacity | The desired initial capacity. |
NULL on error. Definition at line 251 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 260 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 269 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 295 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 320 of file Dictionary.c.
| Dictionary * init | ( | Dictionary * | self | ) |
Initializes this Dictionary.
| self | The Dictionary. |
NULL on error. Definition at line 350 of file Dictionary.c.
| Dictionary * initWithCapacity | ( | Dictionary * | self, |
| size_t | capacity | ||
| ) |
Initializes this Dictionary with the specified capacity.
| self | The Dictionary. |
| capacity | The initial capacity. |
NULL on error. Definition at line 359 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 379 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 409 of file Dictionary.c.
| ident objectForKey | ( | const Dictionary * | self, |
| const ident | key | ||
| ) |
| self | The Dictionary. |
| key | The key. |
Definition at line 439 of file Dictionary.c.
| ident objectForKeyPath | ( | const Dictionary * | self, |
| const char * | path | ||
| ) |
| self | The Dictionary. |
| path | The key path. |
Definition at line 463 of file Dictionary.c.
| ident objectForKeyPathWithClass | ( | const Dictionary * | self, |
| const char * | path, | ||
| const Class * | clazz | ||
| ) |
| self | The Dictionary. |
| path | The key path. |
| clazz | The Class. |
Definition at line 480 of file Dictionary.c.
| void removeAllObjects | ( | Dictionary * | self | ) |
Removes all Objects from this Dictionary.
| self | The Dictionary. |
Definition at line 500 of file Dictionary.c.
| void removeAllObjectsWithEnumerator | ( | Dictionary * | self, |
| DictionaryEnumerator | enumerator, | ||
| ident | data | ||
| ) |
Removes all Objects from this Dictionary, invoking enumerator for each Object and key pair.
| self | The Dictionary. |
| enumerator | The enumerator. |
| data | The data. |
Definition at line 517 of file Dictionary.c.
| void removeObjectForKey | ( | Dictionary * | self, |
| const ident | key | ||
| ) |
Removes the Object with the specified key from this Dictionary.
| self | The Dictionary. |
| key | The key of the Object to remove. |
Definition at line 547 of file Dictionary.c.
| void removeObjectForKeyPath | ( | Dictionary * | self, |
| const char * | path | ||
| ) |
Removes the Object with the specified key path from this Dictionary.
| self | The Dictionary. |
| path | The key path of the Object to remove. |
Definition at line 577 of file Dictionary.c.
| void setObjectForKey | ( | Dictionary * | self, |
| const ident | obj, | ||
| const ident | key | ||
| ) |
Sets a pair in this Dictionary.
| self | The Dictionary. |
| obj | The Object to set. |
| key | The key of the Object to set. |
Definition at line 634 of file Dictionary.c.
| void setObjectForKeyPath | ( | Dictionary * | self, |
| const ident | obj, | ||
| const char * | path | ||
| ) |
Sets a pair in this Dictionary.
| self | The Dictionary. |
| obj | The Object to set. |
| path | The key path of the Object to set. |
Definition at line 662 of file Dictionary.c.
| void setObjectsForKeyPaths | ( | Dictionary * | self, |
| ... | |||
| ) |
Sets pairs in this Dictionary from the NULL-terminated list.
| self | The Dictionary. |
Definition at line 675 of file Dictionary.c.
| void setObjectsForKeys | ( | Dictionary * | self, |
| ... | |||
| ) |
Sets pairs in this Dictionary from the NULL-terminated list.
| self | The Dictionary. |
Definition at line 698 of file Dictionary.c.