20#ifndef __STDC_LIMIT_MACROS
21# define __STDC_LIMIT_MACROS
23#ifndef __STDC_CONSTANT_MACROS
24# define __STDC_CONSTANT_MACROS
33# import "OFKernelEventObserver.h"
36OF_ASSUME_NONNULL_BEGIN
43#if defined(OF_HAVE_SOCKETS) && defined(OF_HAVE_BLOCKS)
66 id _Nullable exception);
80 id _Nullable exception);
94 size_t bytesWritten,
id _Nullable exception);
115 didReadIntoBuffer: (
void *)buffer
116 length: (
size_t)length
117 exception: (nullable
id)exception;
130 didReadLine: (nullable
OFString *)line
131 exception: (nullable
id)exception;
146 didWriteData: (
OFData *)data
147 bytesWritten: (
size_t)bytesWritten
148 exception: (nullable
id)exception;
166 bytesWritten: (
size_t)bytesWritten
167 exception: (nullable
id)exception;
193 id _Nullable _delegate;
194#ifndef OF_SEEKABLE_STREAM_M
197 char *_Nullable _readBuffer, *_Nullable _readBufferMemory;
198 char *_Nullable _writeBuffer;
199 size_t _readBufferLength, _writeBufferLength;
200 bool _buffersWrites, _waitingForDelimiter;
207@property (readonly, nonatomic, getter=isAtEndOfStream)
bool atEndOfStream;
212@property (nonatomic)
bool buffersWrites;
217@property (readonly, nonatomic)
bool hasDataInReadBuffer;
228@property (nonatomic)
bool canBlock;
236@property OF_NULLABLE_PROPERTY (assign, nonatomic)
237 id <OFStreamDelegate> delegate;
257- (size_t)readIntoBuffer: (
void *)buffer length: (
size_t)length;
278 - (void)readIntoBuffer: (
void *)buffer exactLength: (
size_t)length;
280#ifdef OF_HAVE_SOCKETS
301- (void)asyncReadIntoBuffer: (
void *)buffer length: (
size_t)length;
324- (void)asyncReadIntoBuffer: (
void *)buffer
325 length: (
size_t)length
344- (void)asyncReadIntoBuffer: (
void *)buffer exactLength: (
size_t)length;
363- (void)asyncReadIntoBuffer: (
void *)buffer
364 exactLength: (
size_t)length
367# ifdef OF_HAVE_BLOCKS
393- (void)asyncReadIntoBuffer: (
void *)buffer
394 length: (
size_t)length
423- (void)asyncReadIntoBuffer: (
void *)buffer
424 length: (
size_t)length
449- (void)asyncReadIntoBuffer: (
void *)buffer
450 exactLength: (
size_t)length
475- (void)asyncReadIntoBuffer: (
void *)buffer
476 exactLength: (
size_t)length
508- (uint16_t)readBigEndianInt16;
522- (uint32_t)readBigEndianInt32;
536- (uint64_t)readBigEndianInt64;
550- (float)readBigEndianFloat;
564- (double)readBigEndianDouble;
578- (uint16_t)readLittleEndianInt16;
592- (uint32_t)readLittleEndianInt32;
606- (uint64_t)readLittleEndianInt64;
620- (float)readLittleEndianFloat;
634- (double)readLittleEndianDouble;
650- (
OFData *)readDataWithCount: (
size_t)count;
667- (
OFData *)readDataWithItemSize: (
size_t)itemSize count: (
size_t)count;
677- (
OFData *)readDataUntilEndOfStream;
699- (
OFString *)readStringWithLength: (
size_t)length;
722- (
OFString *)readStringWithLength: (
size_t)length
751#ifdef OF_HAVE_SOCKETS
759- (void)asyncReadLine;
785# ifdef OF_HAVE_BLOCKS
936- (bool)flushWriteBuffer;
953- (void)writeBuffer: (const
void *)buffer length: (
size_t)length;
955#ifdef OF_HAVE_SOCKETS
964- (void)asyncWriteData: (
OFData *)data;
975- (void)asyncWriteData: (
OFData *)data
986- (void)asyncWriteString: (
OFString *)string;
999- (void)asyncWriteString: (
OFString *)string
1014- (void)asyncWriteString: (
OFString *)string
1018# ifdef OF_HAVE_BLOCKS
1030- (void)asyncWriteData: (
OFData *)data
1045- (void)asyncWriteData: (
OFData *)data
1060- (void)asyncWriteString: (
OFString *)string
1077- (void)asyncWriteString: (
OFString *)string
1096- (void)asyncWriteString: (
OFString *)string
1112- (void)writeInt8: (uint8_t)int8;
1123- (void)writeBigEndianInt16: (uint16_t)int16;
1134- (void)writeBigEndianInt32: (uint32_t)int32;
1145- (void)writeBigEndianInt64: (uint64_t)int64;
1156- (void)writeBigEndianFloat: (
float)float_;
1167- (void)writeBigEndianDouble: (
double)double_;
1178- (void)writeLittleEndianInt16: (uint16_t)int16;
1189- (void)writeLittleEndianInt32: (uint32_t)int32;
1200- (void)writeLittleEndianInt64: (uint64_t)int64;
1211- (void)writeLittleEndianFloat: (
float)float_;
1222- (void)writeLittleEndianDouble: (
double)double_;
1233- (void)writeData: (
OFData *)data;
1244- (void)writeString: (
OFString *)string;
1268- (void)writeLine: (
OFString *)string;
1314- (void)writeFormat: (
OFConstantString *)format arguments: (va_list)arguments;
1316#ifdef OF_HAVE_SOCKETS
1320- (void)cancelAsyncRequests;
1344- (void)unreadFromBuffer: (const
void *)buffer length: (
size_t)length;
1369- (size_t)lowlevelReadIntoBuffer: (
void *)buffer length: (
size_t)length;
1385- (size_t)lowlevelWriteBuffer: (const
void *)buffer length: (
size_t)length;
1397- (bool)lowlevelIsAtEndOfStream;
1410- (bool)lowlevelHasDataInReadBuffer;
1413OF_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:79
bool(^ OFStreamAsyncReadBlock)(size_t length, id exception)
A block which is called when data was read asynchronously from a stream.
Definition OFStream.h:53
bool(^ OFStreamAsyncReadLineBlock)(OFString *line, id exception)
A block which is called when a line was read asynchronously from a stream.
Definition OFStream.h:65
OFString *(^ OFStreamAsyncWriteStringBlock)(size_t bytesWritten, id exception)
A block which is called when a string was written asynchronously to a stream.
Definition OFStream.h:93
OFStringEncoding
The encoding of a string.
Definition OFString.h:65
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:46
The root class for all other classes inside ObjFW.
Definition OFObject.h:692
A base class for different types of streams.
Definition OFStream.h:192
A class for handling strings.
Definition OFString.h:139
A protocol for the creation of copies.
Definition OFObject.h:1350