ObjFW  Diff

Differences From Artifact [a12c7e5760]:

To Artifact [2a76fef6e1]:


8
9
10
11
12
13
14

15
16
17
18
19
20
21
22
23
24
25
26
27

28
29
30
31
32
33
34
 * Q Public License 1.0, which can be found in the file LICENSE included in
 * the packaging of this file.
 */

#include <stdarg.h>

#import "OFObject.h"

#import "OFEnumerator.h"

@class OFDataArray;
@class OFString;

#ifdef OF_HAVE_BLOCKS
typedef void (^of_array_enumeration_block_t)(id obj, size_t idx, BOOL *stop);
#endif

/**
 * \brief A class for storing objects in an array.
 */
@interface OFArray: OFObject <OFCopying, OFMutableCopying, OFFastEnumeration>

{
	OFDataArray *array;
}

/**
 * \return A new autoreleased OFArray
 */







>












|
>







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 * Q Public License 1.0, which can be found in the file LICENSE included in
 * the packaging of this file.
 */

#include <stdarg.h>

#import "OFObject.h"
#import "OFCollection.h"
#import "OFEnumerator.h"

@class OFDataArray;
@class OFString;

#ifdef OF_HAVE_BLOCKS
typedef void (^of_array_enumeration_block_t)(id obj, size_t idx, BOOL *stop);
#endif

/**
 * \brief A class for storing objects in an array.
 */
@interface OFArray: OFObject <OFCopying, OFMutableCopying, OFCollection,
    OFFastEnumeration>
{
	OFDataArray *array;
}

/**
 * \return A new autoreleased OFArray
 */
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
 * \param objs A C array of objects
 * \param len The length of the C array
 * \return An initialized OFArray
 */
- initWithCArray: (id*)objs
	  length: (size_t)len;

/**
 * \return The number of objects in the array
 */
- (size_t)count;

/**
 * \return The objects of the array as a C array
 */
- (id*)cArray;

/**
 * Returns a specific object of the array.







<
<
<
<
<







112
113
114
115
116
117
118





119
120
121
122
123
124
125
 * \param objs A C array of objects
 * \param len The length of the C array
 * \return An initialized OFArray
 */
- initWithCArray: (id*)objs
	  length: (size_t)len;






/**
 * \return The objects of the array as a C array
 */
- (id*)cArray;

/**
 * Returns a specific object of the array.
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
 * Creates a string by joining all objects of the array.
 *
 * \param separator The string with which the objects should be joined
 * \return A string containing all objects joined by the separator
 */
- (OFString*)componentsJoinedByString: (OFString*)separator;

/**
 * \return An OFEnumerator to enumarate through the array's objects
 */
- (OFEnumerator*)objectEnumerator;

#ifdef OF_HAVE_BLOCKS
/**
 * Executes a block for each object.
 *
 * \param block The block to execute for each object
 */
- (void)enumerateObjectsUsingBlock: (of_array_enumeration_block_t)block;







<
<
<
<
<







175
176
177
178
179
180
181





182
183
184
185
186
187
188
 * Creates a string by joining all objects of the array.
 *
 * \param separator The string with which the objects should be joined
 * \return A string containing all objects joined by the separator
 */
- (OFString*)componentsJoinedByString: (OFString*)separator;






#ifdef OF_HAVE_BLOCKS
/**
 * Executes a block for each object.
 *
 * \param block The block to execute for each object
 */
- (void)enumerateObjectsUsingBlock: (of_array_enumeration_block_t)block;