17 #ifndef __STDC_LIMIT_MACROS 18 # define __STDC_LIMIT_MACROS 20 #ifndef __STDC_CONSTANT_MACROS 21 # define __STDC_CONSTANT_MACROS 27 #import "OFCollection.h" 28 #import "OFSerialization.h" 30 OF_ASSUME_NONNULL_BEGIN
34 @class OFArray OF_GENERIC(ObjectType);
65 #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) 66 # define ObjectType id 81 + (instancetype)setWithSet: (
OFSet OF_GENERIC(ObjectType) *)set;
89 + (instancetype)setWithArray: (
OFArray OF_GENERIC(ObjectType) *)array;
97 + (instancetype)setWithObjects: (ObjectType)firstObject, ...;
106 + (instancetype)setWithObjects: (ObjectType const _Nonnull *_Nonnull)objects
107 count: (
size_t)count;
115 - initWithSet: (
OFSet OF_GENERIC(ObjectType) *)set;
123 - initWithArray: (
OFArray OF_GENERIC(ObjectType) *)array;
131 - initWithObjects: (ObjectType)firstObject, ...;
140 - initWithObjects: (ObjectType const _Nonnull *_Nonnull)objects
141 count: (
size_t)count;
151 - initWithObject: (ObjectType)firstObject
152 arguments: (va_list)arguments;
159 - (bool)isSubsetOfSet: (
OFSet OF_GENERIC(ObjectType) *)set;
168 - (bool)intersectsSet: (
OFSet OF_GENERIC(ObjectType) *)set;
176 - (
OFSet OF_GENERIC(ObjectType) *)setBySubtractingSet:
177 (
OFSet OF_GENERIC(ObjectType) *)set;
185 - (
OFSet OF_GENERIC(ObjectType) *)setByIntersectingWithSet:
186 (
OFSet OF_GENERIC(ObjectType) *)set;
194 - (
OFSet OF_GENERIC(ObjectType) *)setByAddingSet:
195 (
OFSet OF_GENERIC(ObjectType) *)set;
218 - (bool)containsObject: (ObjectType)object;
233 - (nullable id)valueForKey: (
OFString *)key;
248 - (void)setValue: (
id)value
258 #ifdef OF_HAVE_BLOCKS 273 - (
OFSet OF_GENERIC(ObjectType) *)filteredSetUsingBlock:
276 #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) 281 OF_ASSUME_NONNULL_END
283 #import "OFMutableSet.h" An abstract class for an unordered set of unique objects.
Definition: OFSet.h:63
A protocol for the creation of mutable copies.
Definition: OFObject.h:935
OFArray * allObjects()
Returns an array of all objects in the set.
Definition: OFSet.m:433
A class for handling strings.
Definition: OFString.h:114
instancetype set()
Creates a new set.
Definition: OFSet.m:118
A class which provides methods to enumerate through collections.
Definition: OFEnumerator.h:44
OFEnumerator * objectEnumerator()
Returns an OFEnumerator to enumerate through all objects of the set.
Definition: OFSet.m:267
A protocol with methods common for all collections.
bool(^ of_set_filter_block_t)(id object)
A block for filtering an OFSet.
Definition: OFSet.h:52
A protocol for the creation of copies.
Definition: OFObject.h:914
The root class for all other classes inside ObjFW.
Definition: OFObject.h:379
void(^ of_set_enumeration_block_t)(id object, bool *stop)
A block for enumerating an OFSet.
Definition: OFSet.h:44
An abstract class for storing objects in an array.
Definition: OFArray.h:89
nullable ObjectType anyObject()
Returns an arbitrary object in the set.
Definition: OFSet.m:442
A protocol for serializing objects.
Definition: OFSerialization.h:30