17#import "OFMessagePackRepresentation.h"
21OF_ASSUME_NONNULL_BEGIN
46@property (readonly, nonatomic)
size_t itemSize;
51@property (readonly, nonatomic)
size_t count;
58@property OF_NULLABLE_PROPERTY (readonly, nonatomic)
const void *
items
59 OF_RETURNS_INNER_POINTER;
64@property OF_NULLABLE_PROPERTY (readonly, nonatomic)
const void *
firstItem
65 OF_RETURNS_INNER_POINTER;
70@property OF_NULLABLE_PROPERTY (readonly, nonatomic)
const void *
lastItem
71 OF_RETURNS_INNER_POINTER;
99+ (instancetype)dataWithItemSize: (
size_t)itemSize;
108+ (instancetype)dataWithItems: (const
void *)items count: (
size_t)count;
119+ (instancetype)dataWithItems: (const
void *)items
121 itemSize: (
size_t)itemSize;
136+ (instancetype)dataWithItemsNoCopy: (
void *)items
138 freeWhenDone: (
bool)freeWhenDone;
154+ (instancetype)dataWithItemsNoCopy: (
void *)items
156 itemSize: (
size_t)itemSize
157 freeWhenDone: (
bool)freeWhenDone;
167+ (instancetype)dataWithContentsOfFile: (
OFString *)path;
177+ (instancetype)dataWithContentsOfIRI: (
OFIRI *)IRI;
188+ (instancetype)dataWithStringRepresentation: (
OFString *)string;
199+ (instancetype)dataWithBase64EncodedString: (
OFString *)string;
216- (instancetype)initWithItemSize: (
size_t)itemSize;
226- (instancetype)initWithItems: (const
void *)items count: (
size_t)count;
237- (instancetype)initWithItems: (const
void *)items
239 itemSize: (
size_t)itemSize;
255- (instancetype)initWithItemsNoCopy: (
void *)items
257 freeWhenDone: (
bool)freeWhenDone;
274- (instancetype)initWithItemsNoCopy: (
void *)items
276 itemSize: (
size_t)itemSize
277 freeWhenDone: (
bool)freeWhenDone;
287- (instancetype)initWithContentsOfFile: (
OFString *)path;
297- (instancetype)initWithContentsOfIRI: (
OFIRI *)IRI;
308- (instancetype)initWithStringRepresentation: (
OFString *)string;
319- (instancetype)initWithBase64EncodedString: (
OFString *)string;
335- (const
void *)itemAtIndex: (
size_t)index OF_RETURNS_INNER_POINTER;
364- (void)writeToFile: (
OFString *)path;
372- (void)writeToIRI: (
OFIRI *)IRI;
377#import "OFMutableData.h"
378#import "OFData+CryptographicHashing.h"
379#import "OFData+MessagePackParsing.h"
OFDataSearchOptions
Options for searching in data.
Definition OFData.h:31
@ OFDataSearchBackwards
Definition OFData.h:33
OFComparisonResult
A result of a comparison.
Definition OFObject.h:54
A class for storing arbitrary data in an array.
Definition OFData.h:42
const void * lastItem
The last item of the OFData or NULL.
Definition OFData.h:71
size_t count
The number of items in the OFData.
Definition OFData.h:51
const void * items
All elements of the OFData as a C array.
Definition OFData.h:59
OFString * stringRepresentation
The string representation of the data.
Definition OFData.h:79
const void * firstItem
The first item of the OFData or NULL.
Definition OFData.h:65
instancetype data()
Creates a new OFData that is empty with an item size of 1.
Definition OFData.m:146
size_t itemSize
The size of a single item in the OFData in bytes.
Definition OFData.h:46
instancetype init()
Initializes an already allocated OFData to be empty with an item size of 1.
Definition OFData.m:213
OFString * stringByBase64Encoding
A string containing the data in Base64 encoding.
Definition OFData.h:84
A class for representing IRIs, URIs, URLs and URNs, for parsing them as well as accessing parts of th...
Definition OFIRI.h:37
The root class for all other classes inside ObjFW.
Definition OFObject.h:688
A class for handling strings.
Definition OFString.h:135
A protocol for comparing objects.
Definition OFObject.h:1384
A protocol for the creation of copies.
Definition OFObject.h:1346
A protocol implemented by classes that support encoding to a MessagePack representation.
Definition OFMessagePackRepresentation.h:29
A protocol for the creation of mutable copies.
Definition OFObject.h:1367
A range.
Definition OFObject.h:106