16#ifndef __STDC_LIMIT_MACROS
17# define __STDC_LIMIT_MACROS
19#ifndef __STDC_CONSTANT_MACROS
20# define __STDC_CONSTANT_MACROS
29# import "OFKernelEventObserver.h"
32OF_ASSUME_NONNULL_BEGIN
39#if defined(OF_HAVE_SOCKETS) && defined(OF_HAVE_BLOCKS)
62 id _Nullable exception);
76 id _Nullable exception);
90 size_t bytesWritten,
id _Nullable exception);
111 didReadIntoBuffer: (
void *)buffer
112 length: (
size_t)length
113 exception: (nullable
id)exception;
126 didReadLine: (nullable
OFString *)line
127 exception: (nullable
id)exception;
142 didWriteData: (
OFData *)data
143 bytesWritten: (
size_t)bytesWritten
144 exception: (nullable
id)exception;
162 bytesWritten: (
size_t)bytesWritten
163 exception: (nullable
id)exception;
189 id _Nullable _delegate;
190#ifndef OF_SEEKABLE_STREAM_M
193 char *_Nullable _readBuffer, *_Nullable _readBufferMemory;
194 char *_Nullable _writeBuffer;
195 size_t _readBufferLength, _writeBufferLength;
196 bool _buffersWrites, _waitingForDelimiter;
203@property (readonly, nonatomic, getter=isAtEndOfStream)
bool atEndOfStream;
208@property (nonatomic)
bool buffersWrites;
213@property (readonly, nonatomic)
bool hasDataInReadBuffer;
224@property (nonatomic)
bool canBlock;
232@property OF_NULLABLE_PROPERTY (assign, nonatomic)
233 id <OFStreamDelegate> delegate;
253- (size_t)readIntoBuffer: (
void *)buffer length: (
size_t)length;
274 - (void)readIntoBuffer: (
void *)buffer exactLength: (
size_t)length;
276#ifdef OF_HAVE_SOCKETS
297- (void)asyncReadIntoBuffer: (
void *)buffer length: (
size_t)length;
320- (void)asyncReadIntoBuffer: (
void *)buffer
321 length: (
size_t)length
340- (void)asyncReadIntoBuffer: (
void *)buffer exactLength: (
size_t)length;
359- (void)asyncReadIntoBuffer: (
void *)buffer
360 exactLength: (
size_t)length
363# ifdef OF_HAVE_BLOCKS
389- (void)asyncReadIntoBuffer: (
void *)buffer
390 length: (
size_t)length
419- (void)asyncReadIntoBuffer: (
void *)buffer
420 length: (
size_t)length
445- (void)asyncReadIntoBuffer: (
void *)buffer
446 exactLength: (
size_t)length
471- (void)asyncReadIntoBuffer: (
void *)buffer
472 exactLength: (
size_t)length
504- (uint16_t)readBigEndianInt16;
518- (uint32_t)readBigEndianInt32;
532- (uint64_t)readBigEndianInt64;
546- (float)readBigEndianFloat;
560- (double)readBigEndianDouble;
574- (uint16_t)readLittleEndianInt16;
588- (uint32_t)readLittleEndianInt32;
602- (uint64_t)readLittleEndianInt64;
616- (float)readLittleEndianFloat;
630- (double)readLittleEndianDouble;
646- (
OFData *)readDataWithCount: (
size_t)count;
663- (
OFData *)readDataWithItemSize: (
size_t)itemSize count: (
size_t)count;
673- (
OFData *)readDataUntilEndOfStream;
695- (
OFString *)readStringWithLength: (
size_t)length;
718- (
OFString *)readStringWithLength: (
size_t)length
747#ifdef OF_HAVE_SOCKETS
755- (void)asyncReadLine;
781# ifdef OF_HAVE_BLOCKS
932- (bool)flushWriteBuffer;
949- (void)writeBuffer: (const
void *)buffer length: (
size_t)length;
951#ifdef OF_HAVE_SOCKETS
960- (void)asyncWriteData: (
OFData *)data;
971- (void)asyncWriteData: (
OFData *)data
982- (void)asyncWriteString: (
OFString *)string;
995- (void)asyncWriteString: (
OFString *)string
1010- (void)asyncWriteString: (
OFString *)string
1014# ifdef OF_HAVE_BLOCKS
1026- (void)asyncWriteData: (
OFData *)data
1041- (void)asyncWriteData: (
OFData *)data
1056- (void)asyncWriteString: (
OFString *)string
1073- (void)asyncWriteString: (
OFString *)string
1092- (void)asyncWriteString: (
OFString *)string
1108- (void)writeInt8: (uint8_t)int8;
1119- (void)writeBigEndianInt16: (uint16_t)int16;
1130- (void)writeBigEndianInt32: (uint32_t)int32;
1141- (void)writeBigEndianInt64: (uint64_t)int64;
1152- (void)writeBigEndianFloat: (
float)float_;
1163- (void)writeBigEndianDouble: (
double)double_;
1174- (void)writeLittleEndianInt16: (uint16_t)int16;
1185- (void)writeLittleEndianInt32: (uint32_t)int32;
1196- (void)writeLittleEndianInt64: (uint64_t)int64;
1207- (void)writeLittleEndianFloat: (
float)float_;
1218- (void)writeLittleEndianDouble: (
double)double_;
1229- (void)writeData: (
OFData *)data;
1240- (void)writeString: (
OFString *)string;
1264- (void)writeLine: (
OFString *)string;
1310- (void)writeFormat: (
OFConstantString *)format arguments: (va_list)arguments;
1312#ifdef OF_HAVE_SOCKETS
1316- (void)cancelAsyncRequests;
1340- (void)unreadFromBuffer: (const
void *)buffer length: (
size_t)length;
1365- (size_t)lowlevelReadIntoBuffer: (
void *)buffer length: (
size_t)length;
1381- (size_t)lowlevelWriteBuffer: (const
void *)buffer length: (
size_t)length;
1393- (bool)lowlevelIsAtEndOfStream;
1396OF_ASSUME_NONNULL_END
OFData *(^ OFStreamAsyncWriteDataBlock)(size_t bytesWritten, id exception)
A block which is called when data was written asynchronously to a stream.
Definition OFStream.h:75
bool(^ OFStreamAsyncReadBlock)(size_t length, id exception)
A block which is called when data was read asynchronously from a stream.
Definition OFStream.h:49
bool(^ OFStreamAsyncReadLineBlock)(OFString *line, id exception)
A block which is called when a line was read asynchronously from a stream.
Definition OFStream.h:61
OFString *(^ OFStreamAsyncWriteStringBlock)(size_t bytesWritten, id exception)
A block which is called when a string was written asynchronously to a stream.
Definition OFStream.h:89
OFStringEncoding
The encoding of a string.
Definition OFString.h:61
A class for storing constant strings using the @"" literal.
Definition OFConstantString.h:38
A class for storing arbitrary data in an array.
Definition OFData.h:42
The root class for all other classes inside ObjFW.
Definition OFObject.h:688
A base class for different types of streams.
Definition OFStream.h:188
A class for handling strings.
Definition OFString.h:135
A protocol for the creation of copies.
Definition OFObject.h:1346