21#import "OFMessagePackRepresentation.h"
25OF_ASSUME_NONNULL_BEGIN
50@property (readonly, nonatomic)
size_t itemSize;
55@property (readonly, nonatomic)
size_t count;
62@property OF_NULLABLE_PROPERTY (readonly, nonatomic)
const void *
items
63 OF_RETURNS_INNER_POINTER;
68@property OF_NULLABLE_PROPERTY (readonly, nonatomic)
const void *
firstItem
69 OF_RETURNS_INNER_POINTER;
74@property OF_NULLABLE_PROPERTY (readonly, nonatomic)
const void *
lastItem
75 OF_RETURNS_INNER_POINTER;
103+ (instancetype)dataWithItemSize: (
size_t)itemSize;
112+ (instancetype)dataWithItems: (const
void *)items count: (
size_t)count;
123+ (instancetype)dataWithItems: (const
void *)items
125 itemSize: (
size_t)itemSize;
140+ (instancetype)dataWithItemsNoCopy: (
void *)items
142 freeWhenDone: (
bool)freeWhenDone;
158+ (instancetype)dataWithItemsNoCopy: (
void *)items
160 itemSize: (
size_t)itemSize
161 freeWhenDone: (
bool)freeWhenDone;
171+ (instancetype)dataWithContentsOfFile: (
OFString *)path;
181+ (instancetype)dataWithContentsOfIRI: (
OFIRI *)IRI;
192+ (instancetype)dataWithStringRepresentation: (
OFString *)string;
203+ (instancetype)dataWithBase64EncodedString: (
OFString *)string;
220- (instancetype)initWithItemSize: (
size_t)itemSize;
230- (instancetype)initWithItems: (const
void *)items count: (
size_t)count;
241- (instancetype)initWithItems: (const
void *)items
243 itemSize: (
size_t)itemSize;
259- (instancetype)initWithItemsNoCopy: (
void *)items
261 freeWhenDone: (
bool)freeWhenDone;
278- (instancetype)initWithItemsNoCopy: (
void *)items
280 itemSize: (
size_t)itemSize
281 freeWhenDone: (
bool)freeWhenDone;
291- (instancetype)initWithContentsOfFile: (
OFString *)path;
301- (instancetype)initWithContentsOfIRI: (
OFIRI *)IRI;
312- (instancetype)initWithStringRepresentation: (
OFString *)string;
323- (instancetype)initWithBase64EncodedString: (
OFString *)string;
339- (const
void *)itemAtIndex: (
size_t)index OF_RETURNS_INNER_POINTER;
368- (void)writeToFile: (
OFString *)path;
376- (void)writeToIRI: (
OFIRI *)IRI;
381#import "OFMutableData.h"
382#import "OFData+CryptographicHashing.h"
383#import "OFData+MessagePackParsing.h"
OFDataSearchOptions
Options for searching in data.
Definition OFData.h:35
@ OFDataSearchBackwards
Definition OFData.h:37
OFComparisonResult
A result of a comparison.
Definition OFObject.h:58
A class for storing arbitrary data in an array.
Definition OFData.h:46
const void * lastItem
The last item of the OFData or NULL.
Definition OFData.h:75
size_t count
The number of items in the OFData.
Definition OFData.h:55
const void * items
All elements of the OFData as a C array.
Definition OFData.h:63
OFString * stringRepresentation
The string representation of the data.
Definition OFData.h:83
const void * firstItem
The first item of the OFData or NULL.
Definition OFData.h:69
instancetype data()
Creates a new OFData that is empty with an item size of 1.
Definition OFData.m:150
size_t itemSize
The size of a single item in the OFData in bytes.
Definition OFData.h:50
instancetype init()
Initializes an already allocated OFData to be empty with an item size of 1.
Definition OFData.m:217
OFString * stringByBase64Encoding
A string containing the data in Base64 encoding.
Definition OFData.h:88
A class for representing IRIs, URIs, URLs and URNs, for parsing them as well as accessing parts of th...
Definition OFIRI.h:41
The root class for all other classes inside ObjFW.
Definition OFObject.h:692
A class for handling strings.
Definition OFString.h:139
A protocol for comparing objects.
Definition OFObject.h:1388
A protocol for the creation of copies.
Definition OFObject.h:1350
A protocol implemented by classes that support encoding to a MessagePack representation.
Definition OFMessagePackRepresentation.h:33
A protocol for the creation of mutable copies.
Definition OFObject.h:1371
A range.
Definition OFObject.h:110