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

AK: Move Stream and SeekableStream from LibCore

`Stream` will be qualified as `AK::Stream` until we remove the
`Core::Stream` namespace. `IODevice` now reuses the `SeekMode` that is
defined by `SeekableStream`, since defining its own would require us to
qualify it with `AK::SeekMode` everywhere.
This commit is contained in:
Tim Schumacher 2023-01-22 05:09:11 +01:00 committed by Andrew Kaster
parent 5f2ea31816
commit 8464da1439
96 changed files with 620 additions and 586 deletions

View file

@ -42,7 +42,7 @@ constexpr WriterBehavior default_behaviors()
template<typename ContainerType, typename HeaderType = Vector<StringView>>
class XSV {
public:
static ErrorOr<void> generate(Core::Stream::Stream& output, ContainerType const& data, WriterTraits traits, HeaderType headers = {}, WriterBehavior behaviors = default_behaviors())
static ErrorOr<void> generate(AK::Stream& output, ContainerType const& data, WriterTraits traits, HeaderType headers = {}, WriterBehavior behaviors = default_behaviors())
{
auto writer = XSV(output, data, traits, headers, behaviors);
auto with_headers = has_flag(writer.m_behaviors, WriterBehavior::WriteHeaders);
@ -63,7 +63,7 @@ public:
return {};
}
static ErrorOr<void> generate_preview(Core::Stream::Stream& output, ContainerType const& data, WriterTraits traits, HeaderType headers = {}, WriterBehavior behaviors = default_behaviors())
static ErrorOr<void> generate_preview(AK::Stream& output, ContainerType const& data, WriterTraits traits, HeaderType headers = {}, WriterBehavior behaviors = default_behaviors())
{
auto writer = XSV(output, data, traits, headers, behaviors);
auto lines_written = 0;
@ -93,7 +93,7 @@ public:
}
private:
XSV(Core::Stream::Stream& output, ContainerType const& data, WriterTraits traits, HeaderType headers = {}, WriterBehavior behaviors = default_behaviors())
XSV(AK::Stream& output, ContainerType const& data, WriterTraits traits, HeaderType headers = {}, WriterBehavior behaviors = default_behaviors())
: m_data(data)
, m_traits(move(traits))
, m_behaviors(behaviors)
@ -170,7 +170,7 @@ private:
WriterTraits m_traits;
WriterBehavior m_behaviors;
HeaderType m_names;
Core::Stream::Stream& m_output;
AK::Stream& m_output;
};
}