ObjFW  Check-in [6ddfe1975c]

Overview
Comment:Add OFEnumerating protocol.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 6ddfe1975c36269ba6e7d046cf2e77f330f6368dfdd8faa3f2a6500ff70b3147
User & Date: js on 2011-05-26 17:23:31
Other Links: manifest | tags
Context
2011-05-29
21:45
Properly check for thread-safe getaddrinfo if it's unknown. check-in: f1bea237ab user: js tags: trunk
2011-05-26
17:23
Add OFEnumerating protocol. check-in: 6ddfe1975c user: js tags: trunk
2011-05-22
00:44
Add -[firstObject] and -[lastObject] to OFList. check-in: fe0aa66897 user: js tags: trunk
Changes

Modified src/OFCollection.h from [6f614eaec7] to [ee176f4168].

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
 */

#import "OFEnumerator.h"

/**
 * \brief A protocol with methods common for all collections.
 */
@protocol OFCollection <OFObject>
#ifdef OF_HAVE_PROPERTIES
@property (readonly) size_t count;
#endif

/**
 * \brief Returns the number of objects in the collection.
 *
 * \return The number of objects in the collection
 */
- (size_t)count;

/**
 * \brief Returns an OFEnumerator to enumerate through all objects of the
 *	  collection.
 *
 * \returns An OFEnumerator to enumerate through all objects of the collection
 */
- (OFEnumerator*)objectEnumerator;

/**
 * \brief Checks whether the collection contains an object equal to the
 *	  specified object.
 *
 * \param The object which is checked for being in the collection
 * \return A boolean whether the collection contains the specified object
 */







|











<
<
<
<
<
<
<
<







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33








34
35
36
37
38
39
40
 */

#import "OFEnumerator.h"

/**
 * \brief A protocol with methods common for all collections.
 */
@protocol OFCollection <OFEnumerating>
#ifdef OF_HAVE_PROPERTIES
@property (readonly) size_t count;
#endif

/**
 * \brief Returns the number of objects in the collection.
 *
 * \return The number of objects in the collection
 */
- (size_t)count;









/**
 * \brief Checks whether the collection contains an object equal to the
 *	  specified object.
 *
 * \param The object which is checked for being in the collection
 * \return A boolean whether the collection contains the specified object
 */

Modified src/OFEnumerator.h from [b57af49ccd] to [992da1f406].

11
12
13
14
15
16
17















18
19
20
21
22
23
24
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"
















/**
 * \brief A class which provides methods to enumerate through collections.
 */
@interface OFEnumerator: OFObject
/**
 * \brief Returns the next object.







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







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
37
38
39
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"

@class OFEnumerator;

/**
 * \brief A protocol for getting an enumerator for the object.
 */
@protocol OFEnumerating <OFObject>
/**
 * \brief Returns an OFEnumerator to enumerate through all objects of the
 *	  collection.
 *
 * \returns An OFEnumerator to enumerate through all objects of the collection
 */
- (OFEnumerator*)objectEnumerator;
@end

/**
 * \brief A class which provides methods to enumerate through collections.
 */
@interface OFEnumerator: OFObject
/**
 * \brief Returns the next object.