18 #import "OFSerialization.h"
19 #import "OFMessagePackRepresentation.h"
21 OF_ASSUME_NONNULL_BEGIN
41 size_t _count, _itemSize, _capacity;
44 #ifdef OF_HAVE_PROPERTIES
45 @property (readonly)
void *items;
46 @property (readonly)
size_t count;
47 @property (readonly)
size_t itemSize;
55 + (instancetype)dataArray;
64 + (instancetype)dataArrayWithItemSize: (
size_t)itemSize;
73 + (instancetype)dataArrayWithCapacity: (
size_t)capacity;
83 + (instancetype)dataArrayWithItemSize: (
size_t)itemSize
84 capacity: (
size_t)capacity;
94 + (instancetype)dataArrayWithContentsOfFile: (
OFString*)path;
97 #if defined(OF_HAVE_FILES) || defined(OF_HAVE_SOCKETS)
105 + (instancetype)dataArrayWithContentsOfURL: (
OFURL*)URL;
115 + (instancetype)dataArrayWithStringRepresentation: (
OFString*)string;
124 + (instancetype)dataArrayWithBase64EncodedString: (
OFString*)string;
133 - initWithItemSize: (
size_t)itemSize;
142 - initWithCapacity: (
size_t)capacity;
153 - initWithItemSize: (
size_t)itemSize
154 capacity: (
size_t)capacity;
164 - initWithContentsOfFile: (
OFString*)path;
167 #if defined(OF_HAVE_FILES) || defined(OF_HAVE_SOCKETS)
175 - initWithContentsOfURL: (
OFURL*)URL;
185 - initWithStringRepresentation: (
OFString*)string;
194 - initWithBase64EncodedString: (
OFString*)string;
220 - (void*)items OF_RETURNS_INNER_POINTER;
228 - (void*)itemAtIndex: (
size_t)index OF_RETURNS_INNER_POINTER;
235 - (nullable void*)firstItem OF_RETURNS_INNER_POINTER;
242 - (nullable void*)lastItem OF_RETURNS_INNER_POINTER;
249 - (void)addItem: (const
void*)item;
257 - (void)insertItem: (const
void*)item
258 atIndex: (
size_t)index;
266 - (void)addItems: (const
void*)items
267 count: (
size_t)count;
276 - (void)insertItems: (const
void*)items
277 atIndex: (
size_t)index
278 count: (
size_t)count;
285 - (void)removeItemAtIndex: (
size_t)index;
292 - (void)removeItemsInRange: (
of_range_t)range;
297 - (void)removeLastItem;
302 - (void)removeAllItems;
319 - (
OFString*)stringByBase64Encoding;
327 - (void)writeToFile: (
OFString*)path;
331 OF_ASSUME_NONNULL_END
333 #import "OFDataArray+Hashing.h"
334 #import "OFDataArray+MessagePackValue.h"
A class for handling strings.
Definition: OFString.h:91
A class for parsing URLs and accessing parts of it.
Definition: OFURL.h:29
A protocol implemented by classes that support encoding to a MessagePack representation.
Definition: OFMessagePackRepresentation.h:30
A protocol for the creation of copies.
Definition: OFObject.h:896
A class for storing arbitrary data in an array.
Definition: OFDataArray.h:37
A protocol for comparing objects.
Definition: OFObject.h:933
The root class for all other classes inside ObjFW.
Definition: OFObject.h:364
A range.
Definition: OFObject.h:65
A protocol for serializing objects.
Definition: OFSerialization.h:30