mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 12:49:19 +00:00
LibCore: Remove Stream::is_{readable,writable}
Next to functions like `is_eof` these were really confusing to use, and the `read`/`write` functions should fail anyways if a stream is not readable/writable.
This commit is contained in:
parent
5a346c4297
commit
5061a905ff
Notes:
sideshowbarker
2024-07-17 03:23:05 +09:00
Author: https://github.com/timschumi
Commit: 5061a905ff
Pull-request: https://github.com/SerenityOS/serenity/pull/16429
Reviewed-by: https://github.com/sin-ack ✅
7 changed files with 1 additions and 32 deletions
|
@ -30,7 +30,6 @@ public:
|
|||
}
|
||||
|
||||
// ^Stream
|
||||
virtual bool is_readable() const override { return m_stream.is_readable(); }
|
||||
virtual ErrorOr<Bytes> read(Bytes bytes) override
|
||||
{
|
||||
if (m_current_byte.has_value() && is_aligned_to_byte_boundary()) {
|
||||
|
@ -40,7 +39,6 @@ public:
|
|||
align_to_byte_boundary();
|
||||
return m_stream.read(bytes);
|
||||
}
|
||||
virtual bool is_writable() const override { return m_stream.is_writable(); }
|
||||
virtual ErrorOr<size_t> write(ReadonlyBytes bytes) override { return m_stream.write(bytes); }
|
||||
virtual bool write_or_error(ReadonlyBytes bytes) override { return m_stream.write_or_error(bytes); }
|
||||
virtual bool is_eof() const override { return m_stream.is_eof() && !m_current_byte.has_value(); }
|
||||
|
@ -147,7 +145,6 @@ public:
|
|||
}
|
||||
|
||||
// ^Stream
|
||||
virtual bool is_readable() const override { return m_stream.is_readable(); }
|
||||
virtual ErrorOr<Bytes> read(Bytes bytes) override
|
||||
{
|
||||
if (m_current_byte.has_value() && is_aligned_to_byte_boundary()) {
|
||||
|
@ -157,7 +154,6 @@ public:
|
|||
align_to_byte_boundary();
|
||||
return m_stream.read(bytes);
|
||||
}
|
||||
virtual bool is_writable() const override { return m_stream.is_writable(); }
|
||||
virtual ErrorOr<size_t> write(ReadonlyBytes bytes) override { return m_stream.write(bytes); }
|
||||
virtual bool write_or_error(ReadonlyBytes bytes) override { return m_stream.write_or_error(bytes); }
|
||||
virtual bool is_eof() const override { return m_stream.is_eof() && !m_current_byte.has_value(); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue