16 #ifndef __STDC_LIMIT_MACROS 17 # define __STDC_LIMIT_MACROS 19 #ifndef __STDC_CONSTANT_MACROS 20 # define __STDC_CONSTANT_MACROS 26 #import "OFCollection.h" 28 OF_ASSUME_NONNULL_BEGIN
32 @class OFArray OF_GENERIC(ObjectType);
66 #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) 67 # define ObjectType id 77 @property OF_NULLABLE_PROPERTY (readonly, nonatomic) ObjectType
anyObject;
92 + (instancetype)setWithSet: (
OFSet OF_GENERIC(ObjectType) *)set;
100 + (instancetype)setWithArray: (
OFArray OF_GENERIC(ObjectType) *)array;
108 + (instancetype)setWithObjects: (ObjectType)firstObject, ...;
117 + (instancetype)setWithObjects: (ObjectType const _Nonnull *_Nonnull)objects
118 count: (
size_t)count;
125 - (instancetype)
init OF_DESIGNATED_INITIALIZER;
133 - (instancetype)initWithSet: (
OFSet OF_GENERIC(ObjectType) *)set;
141 - (instancetype)initWithArray: (
OFArray OF_GENERIC(ObjectType) *)array;
149 - (instancetype)initWithObjects: (ObjectType)firstObject, ... OF_SENTINEL;
159 - (instancetype)initWithObject: (ObjectType)firstObject
160 arguments: (va_list)arguments;
169 - (instancetype)initWithObjects: (ObjectType const _Nonnull *_Nonnull)objects
170 count: (
size_t)count OF_DESIGNATED_INITIALIZER;
184 - (bool)isSubsetOfSet: (
OFSet OF_GENERIC(ObjectType) *)set;
193 - (bool)intersectsSet: (
OFSet OF_GENERIC(ObjectType) *)set;
201 - (
OFSet OF_GENERIC(ObjectType) *)setByAddingObjectsFromSet:
202 (
OFSet OF_GENERIC(ObjectType) *)set;
211 - (bool)containsObject: (ObjectType)object;
225 - (nullable id)valueForKey: (
OFString *)key;
237 - (void)setValue: (nullable
id)value forKey: (
OFString *)key;
239 #ifdef OF_HAVE_BLOCKS 254 - (
OFSet OF_GENERIC(ObjectType) *)
257 #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) 262 OF_ASSUME_NONNULL_END
264 #import "OFMutableSet.h" OFEnumerator * objectEnumerator()
Returns an OFEnumerator to enumerate through all objects of the set.
Definition: OFSet.m:308
An abstract class for storing objects in an array.
Definition: OFArray.h:103
The root class for all other classes inside ObjFW.
Definition: OFObject.h:686
A class for handling strings.
Definition: OFString.h:134
void(^ OFSetEnumerationBlock)(id object, bool *stop)
A block for enumerating an OFSet.
Definition: OFSet.h:42
OFArray * allObjects
An array of all objects in the set.
Definition: OFSet.h:72
A protocol with methods common for all collections.
An abstract class for an unordered set of unique objects.
Definition: OFSet.h:64
instancetype init()
Initializes an already allocated set to be empty.
Definition: OFSet.m:136
instancetype set()
Creates a new set.
Definition: OFSet.m:102
A protocol for the creation of mutable copies.
Definition: OFObject.h:1367
A protocol for the creation of copies.
Definition: OFObject.h:1346
bool(^ OFSetFilterBlock)(id object)
A block for filtering an OFSet.
Definition: OFSet.h:50
ObjectType anyObject
An arbitrary object in the set.
Definition: OFSet.h:77
A class which provides methods to enumerate through collections.
Definition: OFEnumerator.h:99