16 #ifndef __STDC_LIMIT_MACROS
17 # define __STDC_LIMIT_MACROS
19 #ifndef __STDC_CONSTANT_MACROS
20 # define __STDC_CONSTANT_MACROS
26 #import "OFCollection.h"
27 #import "OFSerialization.h"
29 OF_ASSUME_NONNULL_BEGIN
33 @class OFArray OF_GENERIC(ObjectType);
67 #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
68 # define ObjectType id
78 @property OF_NULLABLE_PROPERTY (readonly, nonatomic) ObjectType
anyObject;
93 + (instancetype)setWithSet: (
OFSet OF_GENERIC(ObjectType) *)set;
101 + (instancetype)setWithArray: (
OFArray OF_GENERIC(ObjectType) *)array;
109 + (instancetype)setWithObjects: (ObjectType)firstObject, ...;
118 + (instancetype)setWithObjects: (ObjectType const _Nonnull *_Nonnull)objects
119 count: (
size_t)count;
127 - (instancetype)initWithSet: (
OFSet OF_GENERIC(ObjectType) *)set;
135 - (instancetype)initWithArray: (
OFArray OF_GENERIC(ObjectType) *)array;
143 - (instancetype)initWithObjects: (ObjectType)firstObject, ... OF_SENTINEL;
152 - (instancetype)initWithObjects: (ObjectType const _Nonnull *_Nonnull)objects
153 count: (
size_t)count;
163 - (instancetype)initWithObject: (ObjectType)firstObject
164 arguments: (va_list)arguments;
171 - (bool)isSubsetOfSet: (
OFSet OF_GENERIC(ObjectType) *)set;
180 - (bool)intersectsSet: (
OFSet OF_GENERIC(ObjectType) *)set;
188 - (
OFSet OF_GENERIC(ObjectType) *)setBySubtractingSet:
189 (
OFSet OF_GENERIC(ObjectType) *)set;
197 - (
OFSet OF_GENERIC(ObjectType) *)setByIntersectingWithSet:
198 (
OFSet OF_GENERIC(ObjectType) *)set;
206 - (
OFSet OF_GENERIC(ObjectType) *)setByAddingSet:
207 (
OFSet OF_GENERIC(ObjectType) *)set;
216 - (bool)containsObject: (ObjectType)object;
242 - (void)setValue: (nullable
id)value forKey: (
OFString *)key;
244 #ifdef OF_HAVE_BLOCKS
259 - (
OFSet OF_GENERIC(ObjectType) *)filteredSetUsingBlock:
262 #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
267 OF_ASSUME_NONNULL_END
269 #import "OFMutableSet.h"
bool(^ of_set_filter_block_t)(id object)
A block for filtering an OFSet.
Definition: OFSet.h:51
void(^ of_set_enumeration_block_t)(id object, bool *stop)
A block for enumerating an OFSet.
Definition: OFSet.h:43
struct objc_object * id
A pointer to any object.
Definition: ObjFWRT.h:90
An abstract class for storing objects in an array.
Definition: OFArray.h:92
The root class for all other classes inside ObjFW.
Definition: OFObject.h:520
An abstract class for an unordered set of unique objects.
Definition: OFSet.h:66
instancetype set()
Creates a new set.
Definition: OFSet.m:115
OFArray * allObjects
An array of all objects in the set.
Definition: OFSet.h:73
ObjectType anyObject
An arbitrary object in the set.
Definition: OFSet.h:78
A class for handling strings.
Definition: OFString.h:132
A protocol with methods common for all collections.
Definition: OFCollection.h:25
A protocol for the creation of copies.
Definition: OFObject.h:1187
A protocol for the creation of mutable copies.
Definition: OFObject.h:1208
A protocol for serializing objects.
Definition: OFSerialization.h:29