ObjFW
Classes | Typedefs
OFStream.h File Reference
#include <stdarg.h>
#import "OFObject.h"
#import "OFString.h"
#import "OFKernelEventObserver.h"

Go to the source code of this file.

Classes

class  OFStream
 A base class for different types of streams. More...
 

Typedefs

typedef bool(^ of_stream_async_read_block_t) (OFStream *stream, void *buffer, size_t length, OFException *_Nullable exception)
 A block which is called when data was read from the stream. More...
 
typedef bool(^ of_stream_async_read_line_block_t) (OFStream *stream, OFString *_Nullable line, OFException *_Nullable exception)
 A block which is called when a line was read from the stream. More...
 

Typedef Documentation

◆ of_stream_async_read_block_t

typedef bool(^ of_stream_async_read_block_t) (OFStream *stream, void *buffer, size_t length, OFException *_Nullable exception)

A block which is called when data was read from the stream.

Parameters
streamThe stream on which data was read
bufferA buffer with the data that has been read
lengthThe length of the data that has been read
exceptionAn exception which occurred while reading or nil on success
Returns
A bool whether the same block should be used for the next read

◆ of_stream_async_read_line_block_t

typedef bool(^ of_stream_async_read_line_block_t) (OFStream *stream, OFString *_Nullable line, OFException *_Nullable exception)

A block which is called when a line was read from the stream.

Parameters
streamThe stream on which a line was read
lineThe line which has been read or nil when the end of stream occurred
exceptionAn exception which occurred while reading or nil on success
Returns
A bool whether the same block should be used for the next read