ObjFW
|
A class for storing objects in a hash table. More...
#include <OFDictionary.h>
Public Member Functions | |
id | init () |
id | initWithDictionary: (OFDictionary *dict) |
id | initWithObject:forKey: (id obj,[forKey] id< OFCopying > key) |
id | initWithObjects:forKeys: (OFArray *objs,[forKeys] OFArray *keys) |
id | initWithKeysAndObjects: (id< OFCopying > first,[,]...) |
id | initWithKey:argList: (id< OFCopying > first,[argList] va_list args) |
id | objectForKey: (id key) |
OFEnumerator * | keyEnumerator () |
void | enumerateKeysAndObjectsUsingBlock: (of_dictionary_enumeration_block_t block) |
OFDictionary * | mappedDictionaryUsingBlock: (of_dictionary_map_block_t block) |
OFDictionary * | filteredDictionaryUsingBlock: (of_dictionary_filter_block_t block) |
Static Public Member Functions | |
id | dictionary () |
id | dictionaryWithDictionary: (OFDictionary *dict) |
id | dictionaryWithObject:forKey: (id obj,[forKey] id< OFCopying > key) |
id | dictionaryWithObjects:forKeys: (OFArray *objs,[forKeys] OFArray *keys) |
id | dictionaryWithKeysAndObjects: (id< OFCopying > key,[,]...) |
Protected Attributes | |
struct of_dictionary_bucket ** | data |
uint32_t | size |
size_t | count |
A class for storing objects in a hash table.
id OFDictionary::dictionary | ( | ) | [static, virtual] |
Creates a new OFDictionary.
id OFDictionary::dictionaryWithDictionary: | ( | OFDictionary* | dict | ) | [static, virtual] |
Creates a new OFDictionary with the specified dictionary.
dict | An OFDictionary |
id OFDictionary::dictionaryWithKeysAndObjects: | ( | id <OFCopying> | key, |
[,] | ... | ||
) | [static, virtual] |
Creates a new OFDictionary with the specified keys objects.
key | The first key |
id OFDictionary::dictionaryWithObject:forKey: | ( | id | obj, |
[forKey] id <OFCopying> | key | ||
) | [static, virtual] |
Creates a new OFDictionary with the specified key and object.
key | The key |
obj | The object |
id OFDictionary::dictionaryWithObjects:forKeys: | ( | OFArray* | objs, |
[forKeys] OFArray* | keys | ||
) | [static, virtual] |
Creates a new OFDictionary with the specified keys and objects.
keys | An array of keys |
objs | An array of objects |
void OFDictionary::enumerateKeysAndObjectsUsingBlock: | ( | of_dictionary_enumeration_block_t | block | ) | [virtual] |
Executes a block for each key / object pair.
block | The block to execute for each key / object pair. |
OFDictionary * OFDictionary::filteredDictionaryUsingBlock: | ( | of_dictionary_filter_block_t | block | ) | [virtual] |
Returns a new dictionary, only containing the objects for which the block returns YES.
block | A block which determines if the object should be in the new dictionary |
id OFDictionary::init | ( | ) | [virtual] |
Initializes an already allocated OFDictionary.
Reimplemented from OFObject.
id OFDictionary::initWithDictionary: | ( | OFDictionary* | dict | ) | [virtual] |
Initializes an already allocated OFDictionary with the specified OFDictionary.
dict | An OFDictionary |
id OFDictionary::initWithKey:argList: | ( | id <OFCopying> | first, |
[argList] va_list | args | ||
) | [virtual] |
Initializes an already allocated OFDictionary with the specified key and va_list.
first | The first key |
args | A va_list of the other arguments |
id OFDictionary::initWithKeysAndObjects: | ( | id <OFCopying> | first, |
[,] | ... | ||
) | [virtual] |
Initializes an already allocated OFDictionary with the specified keys and objects.
first | The first key |
id OFDictionary::initWithObject:forKey: | ( | id | obj, |
[forKey] id <OFCopying> | key | ||
) | [virtual] |
Initializes an already allocated OFDictionary with the specified key and object.
key | The key |
obj | The object |
Initializes an already allocated OFDictionary with the specified keys and objects.
keys | An array of keys |
objs | An array of objects |
OFEnumerator * OFDictionary::keyEnumerator | ( | ) | [virtual] |
OFDictionary * OFDictionary::mappedDictionaryUsingBlock: | ( | of_dictionary_map_block_t | block | ) | [virtual] |
Returns a new dictionary, mapping each object using the specified block.
block | A block which maps an object for each object |
id OFDictionary::objectForKey: | ( | id | key | ) | [virtual] |
Returns the object for the given key or nil if the key was not found.
The returned object is not retained and autoreleased for performance reasons!
key | The key whose object should be returned |