20 #ifndef __STDC_LIMIT_MACROS 21 # define __STDC_LIMIT_MACROS 23 #ifndef __STDC_CONSTANT_MACROS 24 # define __STDC_CONSTANT_MACROS 30 #import "OFCollection.h" 32 OF_ASSUME_NONNULL_BEGIN
36 @class OFArray OF_GENERIC(ObjectType);
70 #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) 71 # define ObjectType id 81 @property OF_NULLABLE_PROPERTY (readonly, nonatomic) ObjectType
anyObject;
96 + (instancetype)setWithSet: (
OFSet OF_GENERIC(ObjectType) *)set;
104 + (instancetype)setWithArray: (
OFArray OF_GENERIC(ObjectType) *)array;
112 + (instancetype)setWithObjects: (ObjectType)firstObject, ...;
121 + (instancetype)setWithObjects: (ObjectType const _Nonnull *_Nonnull)objects
122 count: (
size_t)count;
129 - (instancetype)
init OF_DESIGNATED_INITIALIZER;
137 - (instancetype)initWithSet: (
OFSet OF_GENERIC(ObjectType) *)set;
145 - (instancetype)initWithArray: (
OFArray OF_GENERIC(ObjectType) *)array;
153 - (instancetype)initWithObjects: (ObjectType)firstObject, ... OF_SENTINEL;
163 - (instancetype)initWithObject: (ObjectType)firstObject
164 arguments: (va_list)arguments;
173 - (instancetype)initWithObjects: (ObjectType const _Nonnull *_Nonnull)objects
174 count: (
size_t)count OF_DESIGNATED_INITIALIZER;
188 - (bool)isSubsetOfSet: (
OFSet OF_GENERIC(ObjectType) *)set;
197 - (bool)intersectsSet: (
OFSet OF_GENERIC(ObjectType) *)set;
205 - (
OFSet OF_GENERIC(ObjectType) *)setByAddingObjectsFromSet:
206 (
OFSet OF_GENERIC(ObjectType) *)set;
215 - (bool)containsObject: (ObjectType)object;
229 - (nullable id)valueForKey: (
OFString *)key;
241 - (void)setValue: (nullable
id)value forKey: (
OFString *)key;
243 #ifdef OF_HAVE_BLOCKS 258 - (
OFSet OF_GENERIC(ObjectType) *)
261 #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) 266 OF_ASSUME_NONNULL_END
268 #import "OFMutableSet.h" OFEnumerator * objectEnumerator()
Returns an OFEnumerator to enumerate through all objects of the set.
Definition: OFSet.m:312
An abstract class for storing objects in an array.
Definition: OFArray.h:107
The root class for all other classes inside ObjFW.
Definition: OFObject.h:690
A class for handling strings.
Definition: OFString.h:142
void(^ OFSetEnumerationBlock)(id object, bool *stop)
A block for enumerating an OFSet.
Definition: OFSet.h:46
OFArray * allObjects
An array of all objects in the set.
Definition: OFSet.h:76
A protocol with methods common for all collections.
An abstract class for an unordered set of unique objects.
Definition: OFSet.h:68
instancetype init()
Initializes an already allocated set to be empty.
Definition: OFSet.m:140
instancetype set()
Creates a new set.
Definition: OFSet.m:106
A protocol for the creation of mutable copies.
Definition: OFObject.h:1371
A protocol for the creation of copies.
Definition: OFObject.h:1350
bool(^ OFSetFilterBlock)(id object)
A block for filtering an OFSet.
Definition: OFSet.h:54
ObjectType anyObject
An arbitrary object in the set.
Definition: OFSet.h:81
A class which provides methods to enumerate through collections.
Definition: OFEnumerator.h:103