1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:47:35 +00:00

AK: Deprecate the old AK::Stream

This also removes a few cases where the respective header wasn't
actually required to be included.
This commit is contained in:
Tim Schumacher 2023-01-20 14:07:24 +01:00 committed by Andrew Kaster
parent 230cb3b0cb
commit ae64b68717
38 changed files with 116 additions and 120 deletions

View file

@ -9,6 +9,7 @@
#include <AK/Badge.h>
#include <AK/CircularBuffer.h>
#include <AK/DeprecatedStream.h>
#include <AK/DeprecatedString.h>
#include <AK/EnumBits.h>
#include <AK/Function.h>
@ -1071,7 +1072,7 @@ using ReusableUDPSocket = BasicReusableSocket<UDPSocket>;
// Note: This is only a temporary hack, to break up the task of moving away from AK::Stream into smaller parts.
class WrappedAKInputStream final : public Stream {
public:
WrappedAKInputStream(NonnullOwnPtr<InputStream> stream);
WrappedAKInputStream(NonnullOwnPtr<DeprecatedInputStream> stream);
virtual ErrorOr<Bytes> read(Bytes) override;
virtual ErrorOr<void> discard(size_t discarded_bytes) override;
virtual ErrorOr<size_t> write(ReadonlyBytes) override;
@ -1080,13 +1081,13 @@ public:
virtual void close() override;
private:
NonnullOwnPtr<InputStream> m_stream;
NonnullOwnPtr<DeprecatedInputStream> m_stream;
};
// Note: This is only a temporary hack, to break up the task of moving away from AK::Stream into smaller parts.
class WrappedAKOutputStream final : public Stream {
public:
WrappedAKOutputStream(NonnullOwnPtr<OutputStream> stream);
WrappedAKOutputStream(NonnullOwnPtr<DeprecatedOutputStream> stream);
virtual ErrorOr<Bytes> read(Bytes) override;
virtual ErrorOr<size_t> write(ReadonlyBytes) override;
virtual bool is_eof() const override;
@ -1094,11 +1095,11 @@ public:
virtual void close() override;
private:
NonnullOwnPtr<OutputStream> m_stream;
NonnullOwnPtr<DeprecatedOutputStream> m_stream;
};
// Note: This is only a temporary hack, to break up the task of moving away from AK::Stream into smaller parts.
class WrapInAKInputStream final : public InputStream {
class WrapInAKInputStream final : public DeprecatedInputStream {
public:
WrapInAKInputStream(Core::Stream::Stream& stream);
virtual size_t read(Bytes) override;
@ -1111,7 +1112,7 @@ private:
};
// Note: This is only a temporary hack, to break up the task of moving away from AK::Stream into smaller parts.
class WrapInAKOutputStream final : public OutputStream {
class WrapInAKOutputStream final : public DeprecatedOutputStream {
public:
WrapInAKOutputStream(Core::Stream::Stream& stream);
virtual size_t write(ReadonlyBytes) override;