00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #import "ccCArray.h"
00027
00028
00039 #define CCARRAY_FOREACH(__array__, __object__) \
00040 if (__array__) \
00041 for(id *arr = __array__->data->arr, *end = __array__->data->arr + __array__->data->num; \
00042 arr < end && ((__object__ = *arr) != nil || true); \
00043 arr++)
00044
00045 @interface CCArray : NSObject <NSFastEnumeration, NSCoding>
00046 {
00047 @public ccArray *data;
00048 }
00049
00050 + (id) array;
00051 + (id) arrayWithCapacity:(NSUInteger)capacity;
00052 + (id) arrayWithArray:(CCArray*)otherArray;
00053 + (id) arrayWithNSArray:(NSArray*)otherArray;
00054
00055
00056 - (id) initWithCapacity:(NSUInteger)capacity;
00057 - (id) initWithArray:(CCArray*)otherArray;
00058 - (id) initWithNSArray:(NSArray*)otherArray;
00059
00060
00061 - (NSUInteger) count;
00062 - (NSUInteger) capacity;
00063 - (NSUInteger) indexOfObject:(id)object;
00064 - (id) objectAtIndex:(NSUInteger)index;
00065 - (id) lastObject;
00066 - (BOOL) containsObject:(id)object;
00067
00068 #pragma mark Adding Objects
00069
00070 - (void) addObject:(id)object;
00071 - (void) addObjectsFromArray:(CCArray*)otherArray;
00072 - (void) addObjectsFromNSArray:(NSArray*)otherArray;
00073 - (void) insertObject:(id)object atIndex:(NSUInteger)index;
00074
00075 #pragma mark Removing Objects
00076
00077 - (void) removeLastObject;
00078 - (void) removeObject:(id)object;
00079 - (void) removeObjectAtIndex:(NSUInteger)index;
00080 - (void) removeObjectsInArray:(CCArray*)otherArray;
00081 - (void) removeAllObjects;
00082 - (void) fastRemoveObject:(id)object;
00083 - (void) fastRemoveObjectAtIndex:(NSUInteger)index;
00084
00085 - (void) makeObjectsPerformSelector:(SEL)aSelector;
00086 - (void) makeObjectsPerformSelector:(SEL)aSelector withObject:(id)object;
00087
00088 - (NSArray*) getNSArray;
00089
00090 @end