20#ifndef __STDC_LIMIT_MACROS
21# define __STDC_LIMIT_MACROS
23#ifndef __STDC_CONSTANT_MACROS
24# define __STDC_CONSTANT_MACROS
30#import "OFCollection.h"
32OF_ASSUME_NONNULL_BEGIN
36@class OFArray OF_GENERIC(ObjectType);
70#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
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;
258- (
OFSet OF_GENERIC(ObjectType) *)
261#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
268#import "OFMutableSet.h"
bool(^ OFSetFilterBlock)(id object)
A block for filtering an OFSet.
Definition OFSet.h:54
void(^ OFSetEnumerationBlock)(id object, bool *stop)
A block for enumerating an OFSet.
Definition OFSet.h:46
An abstract class for storing objects in an array.
Definition OFArray.h:109
A class which provides methods to enumerate through collections.
Definition OFEnumerator.h:103
The root class for all other classes inside ObjFW.
Definition OFObject.h:692
An abstract class for an unordered set of unique objects.
Definition OFSet.h:69
instancetype set()
Creates a new set.
Definition OFSet.m:106
OFArray * allObjects
An array of all objects in the set.
Definition OFSet.h:76
ObjectType anyObject
An arbitrary object in the set.
Definition OFSet.h:81
instancetype init()
Initializes an already allocated set to be empty.
Definition OFSet.m:140
OFEnumerator * objectEnumerator()
Returns an OFEnumerator to enumerate through all objects of the set.
Definition OFSet.m:312
A class for handling strings.
Definition OFString.h:143
A protocol with methods common for all collections.
Definition OFCollection.h:29
A protocol for the creation of copies.
Definition OFObject.h:1350
A protocol for the creation of mutable copies.
Definition OFObject.h:1371