Index: src/OFArray.h ================================================================== --- src/OFArray.h +++ src/OFArray.h @@ -93,10 +93,46 @@ OFMutableCopying, OFCollection, OFSerialization, OFJSONRepresentation, OFMessagePackRepresentation> #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # define ObjectType id #endif +/*! + * @brief The objects of the array as a C array. + * + * The result is valid until the autorelease pool is released. If you want to + * use the result outside the scope of the current autorelease pool, you have to + * copy it. + */ +@property (readonly, nonatomic) + ObjectType const __unsafe_unretained _Nonnull *_Nonnull objects; + +/*! + * @brief The first object of the array or `nil`. + * + * @warning The returned object is *not* retained and autoreleased for + * performance reasons! + */ +@property OF_NULLABLE_PROPERTY (readonly, nonatomic) ObjectType firstObject; + +/*! + * @brief The last object of the array or `nil`. + * + * @warning The returned object is *not* retained and autoreleased for + * performance reasons! + */ +@property OF_NULLABLE_PROPERTY (readonly, nonatomic) ObjectType lastObject; + +/*! + * @brief The array sorted in ascending order. + */ +@property (readonly, nonatomic) OFArray OF_GENERIC(ObjectType) *sortedArray; + +/*! + * @brief The array with the order reversed. + */ +@property (readonly, nonatomic) OFArray OF_GENERIC(ObjectType) *reversedArray; + /*! * @brief Creates a new OFArray. * * @return A new autoreleased OFArray */ @@ -136,46 +172,10 @@ */ + (instancetype) arrayWithObjects: (ObjectType const _Nonnull *_Nonnull)objects count: (size_t)count; -/*! - * @brief The objects of the array as a C array. - * - * The result is valid until the autorelease pool is released. If you want to - * use the result outside the scope of the current autorelease pool, you have to - * copy it. - */ -@property (readonly, nonatomic) - ObjectType const __unsafe_unretained _Nonnull *_Nonnull objects; - -/*! - * @brief The first object of the array or `nil`. - * - * @warning The returned object is *not* retained and autoreleased for - * performance reasons! - */ -@property OF_NULLABLE_PROPERTY (readonly, nonatomic) ObjectType firstObject; - -/*! - * @brief The last object of the array or `nil`. - * - * @warning The returned object is *not* retained and autoreleased for - * performance reasons! - */ -@property OF_NULLABLE_PROPERTY (readonly, nonatomic) ObjectType lastObject; - -/*! - * @brief The array sorted in ascending order. - */ -@property (readonly, nonatomic) OFArray OF_GENERIC(ObjectType) *sortedArray; - -/*! - * @brief The array with the order reversed. - */ -@property (readonly, nonatomic) OFArray OF_GENERIC(ObjectType) *reversedArray; - /*! * @brief Initializes an OFArray with the specified object. * * @param object An object * @return An initialized OFArray Index: src/OFDictionary.h ================================================================== --- src/OFDictionary.h +++ src/OFDictionary.h @@ -60,10 +60,25 @@ OFMessagePackRepresentation> #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # define KeyType id # define ObjectType id #endif +/*! + * @brief An array of all keys. + */ +@property (readonly, nonatomic) OFArray OF_GENERIC(KeyType) *allKeys; + +/*! + * @brief An array of all objects. + */ +@property (readonly, nonatomic) OFArray OF_GENERIC(ObjectType) *allObjects; + +/*! + * @brief A URL-encoded string with the contents of the dictionary. + */ +@property (readonly, nonatomic) OFString *stringByURLEncoding; + /*! * @brief Creates a new OFDictionary. * * @return A new autoreleased OFDictionary */ @@ -119,25 +134,10 @@ * @return A new autoreleased OFDictionary */ + (instancetype)dictionaryWithKeysAndObjects: (KeyType)firstKey, ... OF_SENTINEL; -/*! - * @brief An array of all keys. - */ -@property (readonly, nonatomic) OFArray OF_GENERIC(KeyType) *allKeys; - -/*! - * @brief An array of all objects. - */ -@property (readonly, nonatomic) OFArray OF_GENERIC(ObjectType) *allObjects; - -/*! - * @brief A URL-encoded string with the contents of the dictionary. - */ -@property (readonly, nonatomic) OFString *stringByURLEncoding; - /*! * @brief Initializes an already allocated OFDictionary with the specified * OFDictionary. * * @param dictionary An OFDictionary Index: src/OFString.h ================================================================== --- src/OFString.h +++ src/OFString.h @@ -119,11 +119,10 @@ * * @brief A class for handling strings. */ @interface OFString: OFObject - /*! * @brief The length of the string in Unicode codepoints. */ @property (readonly, nonatomic) size_t length;