mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 04:57:45 +00:00
AK: Remove the fallible constructor from FixedMemoryStream
This commit is contained in:
parent
8b2f23d016
commit
220fbcaa7e
31 changed files with 185 additions and 209 deletions
|
@ -23,16 +23,6 @@ FixedMemoryStream::FixedMemoryStream(ReadonlyBytes bytes)
|
|||
{
|
||||
}
|
||||
|
||||
ErrorOr<NonnullOwnPtr<FixedMemoryStream>> FixedMemoryStream::construct(Bytes bytes)
|
||||
{
|
||||
return adopt_nonnull_own_or_enomem<FixedMemoryStream>(new (nothrow) FixedMemoryStream(bytes));
|
||||
}
|
||||
|
||||
ErrorOr<NonnullOwnPtr<FixedMemoryStream>> FixedMemoryStream::construct(ReadonlyBytes bytes)
|
||||
{
|
||||
return adopt_nonnull_own_or_enomem<FixedMemoryStream>(new (nothrow) FixedMemoryStream(bytes));
|
||||
}
|
||||
|
||||
bool FixedMemoryStream::is_eof() const
|
||||
{
|
||||
return m_offset >= m_bytes.size();
|
||||
|
|
|
@ -16,8 +16,8 @@ namespace AK {
|
|||
/// using a single read/write head.
|
||||
class FixedMemoryStream final : public SeekableStream {
|
||||
public:
|
||||
static ErrorOr<NonnullOwnPtr<FixedMemoryStream>> construct(Bytes bytes);
|
||||
static ErrorOr<NonnullOwnPtr<FixedMemoryStream>> construct(ReadonlyBytes bytes);
|
||||
explicit FixedMemoryStream(Bytes bytes);
|
||||
explicit FixedMemoryStream(ReadonlyBytes bytes);
|
||||
|
||||
virtual bool is_eof() const override;
|
||||
virtual bool is_open() const override;
|
||||
|
@ -36,9 +36,6 @@ public:
|
|||
size_t remaining() const;
|
||||
|
||||
private:
|
||||
explicit FixedMemoryStream(Bytes bytes);
|
||||
explicit FixedMemoryStream(ReadonlyBytes bytes);
|
||||
|
||||
Bytes m_bytes;
|
||||
size_t m_offset { 0 };
|
||||
bool m_writing_enabled { true };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue