ObjFW  Diff

Differences From Artifact [ecde9fadf5]:

To Artifact [b961e68793]:


25
26
27
28
29
30
31


32
33
34
35
36
37
38
39








40
41








42








43








44
45
46
47
48
49
50

#import "OFObject.h"
#import "OFCollection.h"
#import "OFEnumerator.h"
#import "OFSerialization.h"
#import "OFJSONRepresentation.h"
#import "OFBinaryPackRepresentation.h"



@class OFString;

enum {
	OF_SORT_OPTIONS_DESCENDING = 1
};

#ifdef OF_HAVE_BLOCKS








typedef void (^of_array_enumeration_block_t)(id object, size_t index,
    bool *stop);








typedef bool (^of_array_filter_block_t)(id odject, size_t index);








typedef id (^of_array_map_block_t)(id object, size_t index);








typedef id (^of_array_fold_block_t)(id left, id right);
#endif

/*!
 * @brief An abstract class for storing objects in an array.
 */
@interface OFArray: OFObject <OFCopying, OFMutableCopying, OFCollection,







>
>








>
>
>
>
>
>
>
>


>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>

>
>
>
>
>
>
>
>







25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84

#import "OFObject.h"
#import "OFCollection.h"
#import "OFEnumerator.h"
#import "OFSerialization.h"
#import "OFJSONRepresentation.h"
#import "OFBinaryPackRepresentation.h"

/*! @file */

@class OFString;

enum {
	OF_SORT_OPTIONS_DESCENDING = 1
};

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief A block for enumerating an OFArray.
 *
 * @param object The current object
 * @param index The index of the current object
 * @param stop A pointer to a variable that can be set to true to stop the
 *	       enumeration
 */
typedef void (^of_array_enumeration_block_t)(id object, size_t index,
    bool *stop);

/*!
 * @brief A block for filtering an OFArray.
 *
 * @param object The object to inspect
 * @param index The index of the object to inspect
 * @return Whether the object should be in the filtered array
 */
typedef bool (^of_array_filter_block_t)(id object, size_t index);

/*!
 * @brief A block for mapping objects to objects in an OFArray.
 *
 * @param object The object to map
 * @param index The index of the object to map
 * @return The object to map to
 */
typedef id (^of_array_map_block_t)(id object, size_t index);

/*!
 * @brief A block for folding an OFArray.
 *
 * @param left The object to which the object has been folded so far
 * @param right The object that should be added to the left object
 * @return The left and right side folded into one object
 */
typedef id (^of_array_fold_block_t)(id left, id right);
#endif

/*!
 * @brief An abstract class for storing objects in an array.
 */
@interface OFArray: OFObject <OFCopying, OFMutableCopying, OFCollection,