diff options
author | Tim Schumacher <timschumi@gmx.de> | 2023-02-24 22:38:01 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-03-13 15:16:20 +0000 |
commit | d5871f5717579fab3c093537c44e3cd467560cdd (patch) | |
tree | 9e7e118ae5b7642f0168c5302ee74e9e483ae91c /AK/BufferedStream.h | |
parent | 1d5b45f7d938b15db9da9b12dc4d8b373abd6c7c (diff) | |
download | serenity-d5871f5717579fab3c093537c44e3cd467560cdd.zip |
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.
Diffstat (limited to 'AK/BufferedStream.h')
-rw-r--r-- | AK/BufferedStream.h | 6 |
1 files changed, 3 insertions, 3 deletions
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<Bytes> read(Bytes buffer) override { return m_helper.read(move(buffer)); } - virtual ErrorOr<size_t> write(ReadonlyBytes buffer) override { return m_helper.stream().write(buffer); } + virtual ErrorOr<Bytes> read_some(Bytes buffer) override { return m_helper.read(move(buffer)); } + virtual ErrorOr<size_t> 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(); } |