mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
AK: Don't move trivially copyable types in BufferedStream methods
This commit is contained in:
parent
2d4d16ac37
commit
8b01abf9f7
Notes:
sideshowbarker
2024-07-16 23:57:20 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/SerenityOS/serenity/commit/8b01abf9f7 Pull-request: https://github.com/SerenityOS/serenity/pull/17930 Reviewed-by: https://github.com/gmta Reviewed-by: https://github.com/timschumi ✅
1 changed files with 6 additions and 6 deletions
|
@ -317,7 +317,7 @@ public:
|
||||||
InputBufferedSeekable(InputBufferedSeekable&& other) = default;
|
InputBufferedSeekable(InputBufferedSeekable&& other) = default;
|
||||||
InputBufferedSeekable& operator=(InputBufferedSeekable&& other) = default;
|
InputBufferedSeekable& operator=(InputBufferedSeekable&& other) = default;
|
||||||
|
|
||||||
virtual ErrorOr<Bytes> read_some(Bytes buffer) override { return m_helper.read(move(buffer)); }
|
virtual ErrorOr<Bytes> read_some(Bytes buffer) override { return m_helper.read(buffer); }
|
||||||
virtual ErrorOr<size_t> write_some(ReadonlyBytes buffer) override { return m_helper.stream().write_some(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_eof() const override { return m_helper.is_eof(); }
|
||||||
virtual bool is_open() const override { return m_helper.stream().is_open(); }
|
virtual bool is_open() const override { return m_helper.stream().is_open(); }
|
||||||
|
@ -344,21 +344,21 @@ public:
|
||||||
return m_helper.stream().truncate(length);
|
return m_helper.stream().truncate(length);
|
||||||
}
|
}
|
||||||
|
|
||||||
ErrorOr<StringView> read_line(Bytes buffer) { return m_helper.read_line(move(buffer)); }
|
ErrorOr<StringView> read_line(Bytes buffer) { return m_helper.read_line(buffer); }
|
||||||
ErrorOr<bool> can_read_line()
|
ErrorOr<bool> can_read_line()
|
||||||
{
|
{
|
||||||
return TRY(m_helper.can_read_up_to_delimiter("\n"sv.bytes())) || m_helper.is_eof_with_data_left_over();
|
return TRY(m_helper.can_read_up_to_delimiter("\n"sv.bytes())) || m_helper.is_eof_with_data_left_over();
|
||||||
}
|
}
|
||||||
ErrorOr<Bytes> read_until(Bytes buffer, StringView candidate) { return m_helper.read_until(move(buffer), move(candidate)); }
|
ErrorOr<Bytes> read_until(Bytes buffer, StringView candidate) { return m_helper.read_until(buffer, candidate); }
|
||||||
template<size_t N>
|
template<size_t N>
|
||||||
ErrorOr<Bytes> read_until_any_of(Bytes buffer, Array<StringView, N> candidates) { return m_helper.read_until_any_of(move(buffer), move(candidates)); }
|
ErrorOr<Bytes> read_until_any_of(Bytes buffer, Array<StringView, N> candidates) { return m_helper.read_until_any_of(buffer, move(candidates)); }
|
||||||
ErrorOr<bool> can_read_up_to_delimiter(ReadonlyBytes delimiter) { return m_helper.can_read_up_to_delimiter(delimiter); }
|
ErrorOr<bool> can_read_up_to_delimiter(ReadonlyBytes delimiter) { return m_helper.can_read_up_to_delimiter(delimiter); }
|
||||||
|
|
||||||
// Methods for reading stream into an auto-adjusting buffer
|
// Methods for reading stream into an auto-adjusting buffer
|
||||||
ErrorOr<StringView> read_line_with_resize(ByteBuffer& buffer) { return m_helper.read_line_with_resize(buffer); }
|
ErrorOr<StringView> read_line_with_resize(ByteBuffer& buffer) { return m_helper.read_line_with_resize(buffer); }
|
||||||
ErrorOr<Bytes> read_until_with_resize(ByteBuffer& buffer, StringView candidate) { return m_helper.read_until_with_resize(move(buffer), move(candidate)); }
|
ErrorOr<Bytes> read_until_with_resize(ByteBuffer& buffer, StringView candidate) { return m_helper.read_until_with_resize(buffer, candidate); }
|
||||||
template<size_t N>
|
template<size_t N>
|
||||||
ErrorOr<Bytes> read_until_any_of_with_resize(ByteBuffer& buffer, Array<StringView, N> candidates) { return m_helper.read_until_any_of_with_resize(move(buffer), move(candidates)); }
|
ErrorOr<Bytes> read_until_any_of_with_resize(ByteBuffer& buffer, Array<StringView, N> candidates) { return m_helper.read_until_any_of_with_resize(buffer, move(candidates)); }
|
||||||
|
|
||||||
size_t buffer_size() const { return m_helper.buffer_size(); }
|
size_t buffer_size() const { return m_helper.buffer_size(); }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue