From d5871f5717579fab3c093537c44e3cd467560cdd Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Fri, 24 Feb 2023 22:38:01 +0100 Subject: AK: Rename Stream::{read,write} to Stream::{read_some,write_some} Similar to POSIX read, the basic read and write functions of AK::Stream do not have a lower limit of how much data they read or write (apart from "none at all"). Rename the functions to "read some [data]" and "write some [data]" (with "data" being omitted, since everything here is reading and writing data) to make them sufficiently distinct from the functions that ensure to use the entire buffer (which should be the go-to function for most usages). No functional changes, just a lot of new FIXMEs. --- AK/BufferedStream.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'AK/BufferedStream.h') diff --git a/AK/BufferedStream.h b/AK/BufferedStream.h index b34868952f..4b454d15e9 100644 --- a/AK/BufferedStream.h +++ b/AK/BufferedStream.h @@ -236,7 +236,7 @@ private: auto const fillable_slice = temporary_buffer.span().trim(min(temporary_buffer.size(), m_buffer.empty_space())); size_t nread = 0; do { - auto result = stream().read(fillable_slice); + auto result = stream().read_some(fillable_slice); if (result.is_error()) { if (!result.error().is_errno()) return result.release_error(); @@ -274,8 +274,8 @@ public: BufferedSeekable(BufferedSeekable&& other) = default; BufferedSeekable& operator=(BufferedSeekable&& other) = default; - virtual ErrorOr read(Bytes buffer) override { return m_helper.read(move(buffer)); } - virtual ErrorOr write(ReadonlyBytes buffer) override { return m_helper.stream().write(buffer); } + virtual ErrorOr read_some(Bytes buffer) override { return m_helper.read(move(buffer)); } + virtual ErrorOr write_some(ReadonlyBytes buffer) override { return m_helper.stream().write_some(buffer); } virtual bool is_eof() const override { return m_helper.is_eof(); } virtual bool is_open() const override { return m_helper.stream().is_open(); } virtual void close() override { m_helper.stream().close(); } -- cgit v1.2.3