16 #ifndef __STDC_LIMIT_MACROS
17 # define __STDC_LIMIT_MACROS
19 #ifndef __STDC_CONSTANT_MACROS
20 # define __STDC_CONSTANT_MACROS
28 #ifdef OF_HAVE_SOCKETS
29 # import "OFKernelEventObserver.h"
32 OF_ASSUME_NONNULL_BEGIN
39 #if defined(OF_HAVE_SOCKETS) && defined(OF_HAVE_BLOCKS)
50 id _Nullable exception);
63 id _Nullable exception);
78 OFData *_Nonnull data,
size_t bytesWritten,
id _Nullable exception);
93 OFString *_Nonnull string,
size_t bytesWritten,
id _Nullable exception);
114 didReadIntoBuffer: (
void *)buffer
115 length: (
size_t)length
116 exception: (nullable
id)exception;
129 didReadLine: (nullable
OFString *)line
130 exception: (nullable
id)exception;
145 didWriteData: (
OFData *)data
146 bytesWritten: (
size_t)bytesWritten
147 exception: (nullable
id)exception;
165 bytesWritten: (
size_t)bytesWritten
166 exception: (nullable
id)exception;
192 id _Nullable _delegate;
193 #ifndef OF_SEEKABLE_STREAM_M
196 char *_Nullable _readBuffer, *_Nullable _readBufferMemory;
197 char *_Nullable _writeBuffer;
198 size_t _readBufferLength, _writeBufferLength;
199 bool _buffersWrites, _waitingForDelimiter;
206 @property (readonly, nonatomic, getter=isAtEndOfStream)
bool atEndOfStream;
211 @property (nonatomic, nonatomic)
bool buffersWrites;
216 @property (readonly, nonatomic)
bool hasDataInReadBuffer;
224 @property (nonatomic)
bool canBlock;
232 @property OF_NULLABLE_PROPERTY (assign, nonatomic)
251 - (size_t)readIntoBuffer: (
void *)buffer length: (
size_t)length;
268 - (void)readIntoBuffer: (
void *)buffer exactLength: (
size_t)length;
270 #ifdef OF_HAVE_SOCKETS
291 - (void)asyncReadIntoBuffer: (
void *)buffer length: (
size_t)length;
314 - (void)asyncReadIntoBuffer: (
void *)buffer
315 length: (
size_t)length
334 - (void)asyncReadIntoBuffer: (
void *)buffer exactLength: (
size_t)length;
353 - (void)asyncReadIntoBuffer: (
void *)buffer
354 exactLength: (
size_t)length
357 # ifdef OF_HAVE_BLOCKS
383 - (void)asyncReadIntoBuffer: (
void *)buffer
384 length: (
size_t)length
413 - (void)asyncReadIntoBuffer: (
void *)buffer
414 length: (
size_t)length
439 - (void)asyncReadIntoBuffer: (
void *)buffer
440 exactLength: (
size_t)length
465 - (void)asyncReadIntoBuffer: (
void *)buffer
466 exactLength: (
size_t)length
490 - (uint16_t)readBigEndianInt16;
500 - (uint32_t)readBigEndianInt32;
510 - (uint64_t)readBigEndianInt64;
520 - (float)readBigEndianFloat;
530 - (double)readBigEndianDouble;
544 - (size_t)readBigEndianInt16sIntoBuffer: (uint16_t *)buffer
545 count: (
size_t)count;
559 - (size_t)readBigEndianInt32sIntoBuffer: (uint32_t *)buffer
560 count: (
size_t)count;
574 - (size_t)readBigEndianInt64sIntoBuffer: (uint64_t *)buffer
575 count: (
size_t)count;
589 - (size_t)readBigEndianFloatsIntoBuffer: (
float *)buffer count: (
size_t)count;
603 - (size_t)readBigEndianDoublesIntoBuffer: (
double *)buffer count: (
size_t)count;
613 - (uint16_t)readLittleEndianInt16;
623 - (uint32_t)readLittleEndianInt32;
633 - (uint64_t)readLittleEndianInt64;
643 - (float)readLittleEndianFloat;
653 - (double)readLittleEndianDouble;
667 - (size_t)readLittleEndianInt16sIntoBuffer: (uint16_t *)buffer
668 count: (
size_t)count;
682 - (size_t)readLittleEndianInt32sIntoBuffer: (uint32_t *)buffer
683 count: (
size_t)count;
697 - (size_t)readLittleEndianInt64sIntoBuffer: (uint64_t *)buffer
698 count: (
size_t)count;
712 - (size_t)readLittleEndianFloatsIntoBuffer: (
float *)buffer
713 count: (
size_t)count;
727 - (size_t)readLittleEndianDoublesIntoBuffer: (
double *)buffer
728 count: (
size_t)count;
740 - (
OFData *)readDataWithCount: (
size_t)count;
753 - (
OFData *)readDataWithItemSize: (
size_t)itemSize count: (
size_t)count;
761 - (
OFData *)readDataUntilEndOfStream;
777 - (
OFString *)readStringWithLength: (
size_t)length;
794 - (
OFString *)readStringWithLength: (
size_t)length
815 #ifdef OF_HAVE_SOCKETS
823 - (void)asyncReadLine;
849 # ifdef OF_HAVE_BLOCKS
972 - (void)flushWriteBuffer;
982 - (size_t)writeBuffer: (const
void *)buffer length: (
size_t)length;
984 #ifdef OF_HAVE_SOCKETS
993 - (void)asyncWriteData: (
OFData *)data;
1004 - (void)asyncWriteData: (
OFData *)data
1015 - (void)asyncWriteString: (
OFString *)string;
1028 - (void)asyncWriteString: (
OFString *)string
1043 - (void)asyncWriteString: (
OFString *)string
1047 # ifdef OF_HAVE_BLOCKS
1059 - (void)asyncWriteData: (
OFData *)data
1074 - (void)asyncWriteData: (
OFData *)data
1089 - (void)asyncWriteString: (
OFString *)string
1106 - (void)asyncWriteString: (
OFString *)string
1125 - (void)asyncWriteString: (
OFString *)string
1137 - (void)writeInt8: (uint8_t)int8;
1144 - (void)writeBigEndianInt16: (uint16_t)int16;
1151 - (void)writeBigEndianInt32: (uint32_t)int32;
1158 - (void)writeBigEndianInt64: (uint64_t)int64;
1165 - (void)writeBigEndianFloat: (
float)float_;
1172 - (void)writeBigEndianDouble: (
double)double_;
1183 - (size_t)writeBigEndianInt16s: (const uint16_t *)buffer count: (
size_t)count;
1194 - (size_t)writeBigEndianInt32s: (const uint32_t *)buffer count: (
size_t)count;
1205 - (size_t)writeBigEndianInt64s: (const uint64_t *)buffer count: (
size_t)count;
1216 - (size_t)writeBigEndianFloats: (const
float *)buffer count: (
size_t)count;
1227 - (size_t)writeBigEndianDoubles: (const
double *)buffer count: (
size_t)count;
1234 - (void)writeLittleEndianInt16: (uint16_t)int16;
1241 - (void)writeLittleEndianInt32: (uint32_t)int32;
1248 - (void)writeLittleEndianInt64: (uint64_t)int64;
1255 - (void)writeLittleEndianFloat: (
float)float_;
1262 - (void)writeLittleEndianDouble: (
double)double_;
1273 - (size_t)writeLittleEndianInt16s: (const uint16_t *)buffer
1274 count: (
size_t)count;
1285 - (size_t)writeLittleEndianInt32s: (const uint32_t *)buffer
1286 count: (
size_t)count;
1297 - (size_t)writeLittleEndianInt64s: (const uint64_t *)buffer
1298 count: (
size_t)count;
1309 - (size_t)writeLittleEndianFloats: (const
float *)buffer count: (
size_t)count;
1320 - (size_t)writeLittleEndianDoubles: (const
double *)buffer count: (
size_t)count;
1328 - (size_t)writeData: (
OFData *)data;
1336 - (size_t)writeString: (
OFString *)string;
1346 - (size_t)writeString: (
OFString *)string
1355 - (size_t)writeLine: (
OFString *)string;
1365 - (size_t)writeLine: (
OFString *)string
1391 - (size_t)writeFormat: (
OFConstantString *)format arguments: (va_list)arguments;
1393 #ifdef OF_HAVE_SOCKETS
1397 - (void)cancelAsyncRequests;
1421 - (void)unreadFromBuffer: (const
void *)buffer length: (
size_t)length;
1442 - (size_t)lowlevelReadIntoBuffer: (
void *)buffer length: (
size_t)length;
1456 - (size_t)lowlevelWriteBuffer: (const
void *)buffer length: (
size_t)length;
1468 - (bool)lowlevelIsAtEndOfStream;
1471 OF_ASSUME_NONNULL_END
OFData *_Nullable(^ of_stream_async_write_data_block_t)(OFData *_Nonnull data, size_t bytesWritten, id _Nullable exception)
A block which is called when data was written asynchronously to a stream.
Definition: OFStream.h:77
bool(^ of_stream_async_read_block_t)(size_t length, id _Nullable exception)
A block which is called when data was read asynchronously from a stream.
Definition: OFStream.h:49
OFString *_Nullable(^ of_stream_async_write_string_block_t)(OFString *_Nonnull string, size_t bytesWritten, id _Nullable exception)
A block which is called when a string was written asynchronously to a stream.
Definition: OFStream.h:92
bool(^ of_stream_async_read_line_block_t)(OFString *_Nullable line, id _Nullable exception)
A block which is called when a line was read asynchronously from a stream.
Definition: OFStream.h:62
of_string_encoding_t
The encoding of a string.
Definition: OFString.h:68
struct objc_object * id
A pointer to any object.
Definition: ObjFWRT.h:90
A class for storing constant strings using the @"" literal.
Definition: OFConstantString.h:42
A class for storing arbitrary data in an array.
Definition: OFData.h:40
The root class for all other classes inside ObjFW.
Definition: OFObject.h:520
A base class for different types of streams.
Definition: OFStream.h:191
A class for handling strings.
Definition: OFString.h:132
A protocol for the creation of copies.
Definition: OFObject.h:1187
Definition: OFStream.h:101