@@ -19,11 +19,10 @@ #import "OFObject.h" #import "OFCollection.h" #import "OFEnumerator.h" #import "OFSerialization.h" -@class OFDataArray; @class OFString; #ifdef OF_HAVE_BLOCKS typedef void (^of_array_enumeration_block_t)(id object, size_t index, BOOL *stop); @@ -35,14 +34,10 @@ /** * \brief A class for storing objects in an array. */ @interface OFArray: OFObject -{ - OFDataArray *array; -} - /** * \brief Creates a new OFArray. * * \return A new autoreleased OFArray */ @@ -142,17 +137,10 @@ * \return An initialized OFArray */ - initWithCArray: (id*)objects length: (size_t)length; -/** - * \brief Returns the objects of the array as a C array. - * - * \return The objects of the array as a C array - */ -- (id*)cArray; - /** * \brief Returns a specified object of the array. * * The returned object is not retained and autoreleased for performance * reasons! @@ -160,10 +148,26 @@ * \param index The number of the object to return * \return The specified object of the OFArray */ - (id)objectAtIndex: (size_t)index; +/** + * \brief Copies the objects at the specified range to the specified buffer. + * + * \param buffer The buffer to copy the objects to + * \param range The range to copy + */ +- (void)getObjects: (id*)buffer + inRange: (of_range_t)range; + +/** + * \brief Returns the objects of the array as a C array. + * + * \return The objects of the array as a C array + */ +- (id*)cArray; + /** * \brief Returns the index of the first object that is equivalent to the * specified object or OF_INVALID_INDEX if it was not found. * * \param object The object whose index is returned @@ -210,22 +214,10 @@ * * \return The last object of the array or nil */ - (id)lastObject; -/** - * \brief Returns the objects from the specified index to the specified index as - * a new OFArray. - * - * \param start The index where the subarray starts - * \param end The index where the subarray ends. - * This points BEHIND the last object! - * \return The subarray as a new autoreleased OFArray - */ -- (OFArray*)objectsFromIndex: (size_t)start - toIndex: (size_t)end; - /** * \brief Returns the objects in the specified range as a new OFArray. * * \param range The range for the subarray * \return The subarray as a new autoreleased OFArray @@ -301,22 +293,23 @@ * \return The array folded to a single object */ - (id)foldUsingBlock: (of_array_fold_block_t)block; #endif @end + +@interface OFArrayPlaceholder: OFArray +@end @interface OFArrayEnumerator: OFEnumerator { OFArray *array; - OFDataArray *dataArray; size_t count; unsigned long mutations; unsigned long *mutationsPtr; - size_t pos; + size_t position; } -- initWithArray: (OFArray*)data - dataArray: (OFDataArray*)dataArray - mutationsPointer: (unsigned long*)mutationsPtr; +- initWithArray: (OFArray*)data + mutationsPtr: (unsigned long*)mutationsPtr; @end #import "OFMutableArray.h"