@@ -6,10 +6,12 @@ * * This file is part of libobjfw. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE included in * the packaging of this file. */ + +#include #import "OFObject.h" #import "OFList.h" /** @@ -34,10 +36,18 @@ * \param bits The size of the hash to use * \return A new autoreleased OFDictionary */ + dictionaryWithHashSize: (int)hashsize; +/** + * Creates a new OFDictionary with the specified objects. + * + * \param first The first key + * \return A new autoreleased OFDictionary + */ ++ dictionaryWithKeysAndObjects: (OFObject *)first, ...; + /** * Initializes an already allocated OFDictionary, defaulting to a 12 bit hash. * * \return An initialized OFDictionary */ @@ -49,10 +59,27 @@ * \param bits The size of the hash to use * \return An initialized OFDictionary */ - initWithHashSize: (int)hashsize; +/** + * Initialized an already allocated OFDictionary with the specified objects. + * + * \param first The first key + * \return A new initialized OFDictionary + */ +- initWithKeysAndObjects: (OFObject *)first, ...; + +/** + * Initialized an already allocated OFDictionary with the specified objects. + * + * \param first The first key + * \return A new initialized OFDictionary + */ +- initWithKey: (OFObject *)first + andArgList: (va_list)args; + /** * \return The average number of items in a used bucket. Buckets that are * completely empty are not in the calculation. If this value is >= 2.0, * you should resize the dictionary, in most cases even earlier! */