@@ -1,7 +1,7 @@ /* - * Copyright (c) 2008-2022 Jonathan Schleifer + * Copyright (c) 2008-2024 Jonathan Schleifer * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in @@ -15,11 +15,10 @@ #define __NO_EXT_QNX #include "config.h" -#include #include #include #include #include #include @@ -95,24 +94,29 @@ OFFreeMemory(_writeBuffer); [super dealloc]; } -- (bool)lowlevelIsAtEndOfStream -{ - OF_UNRECOGNIZED_SELECTOR -} - - (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)length { OF_UNRECOGNIZED_SELECTOR } - (size_t)lowlevelWriteBuffer: (const void *)buffer length: (size_t)length { OF_UNRECOGNIZED_SELECTOR } + +- (bool)lowlevelIsAtEndOfStream +{ + OF_UNRECOGNIZED_SELECTOR +} + +- (bool)lowlevelHasDataInReadBuffer +{ + return false; +} - (id)copy { return [self retain]; } @@ -700,11 +704,11 @@ delimiterLength = 1; ret = [OFString stringWithCString: _readBuffer encoding: encoding - length: i + 1 - delimiterLength]; + length: i + 1 - delimiterLength]; _readBuffer += i + 1; _readBufferLength -= i + 1; _waitingForDelimiter = false; @@ -1185,11 +1189,11 @@ } } - (bool)hasDataInReadBuffer { - return (_readBufferLength > 0); + return (_readBufferLength > 0 || [self lowlevelHasDataInReadBuffer]); } - (bool)canBlock { return _canBlock;