summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorBen Wiederhake <BenWiederhake.GitHub@gmx.de>2023-05-19 18:27:36 +0200
committerJelle Raaijmakers <jelle@gmta.nl>2023-05-27 07:16:01 +0200
commit7e70ca10406eb414d4522cfe0ffb76b0468bcd8c (patch)
tree33e66fdb84b34c6bf1a4384739daf47978db7a51 /Userland
parentf93ee3142d2ca4329d989dd917fc27c912b60806 (diff)
downloadserenity-7e70ca10406eb414d4522cfe0ffb76b0468bcd8c.zip
LibCore: Remove deprecated LineRange and LineIterator
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibCore/IODevice.cpp23
-rw-r--r--Userland/Libraries/LibCore/IODevice.h45
2 files changed, 0 insertions, 68 deletions
diff --git a/Userland/Libraries/LibCore/IODevice.cpp b/Userland/Libraries/LibCore/IODevice.cpp
index 542dd98bcb..b8e156d01f 100644
--- a/Userland/Libraries/LibCore/IODevice.cpp
+++ b/Userland/Libraries/LibCore/IODevice.cpp
@@ -297,27 +297,4 @@ bool IODevice::write(StringView v)
return write((u8 const*)v.characters_without_null_termination(), v.length());
}
-LineIterator::LineIterator(IODevice& device, bool is_end)
- : m_device(device)
- , m_is_end(is_end)
-{
- if (!m_is_end) {
- ++*this;
- }
-}
-
-bool LineIterator::at_end() const
-{
- return m_device->eof();
-}
-
-LineIterator& LineIterator::operator++()
-{
- m_buffer = m_device->read_line();
- return *this;
-}
-
-LineIterator LineRange::begin() { return m_device.line_begin(); }
-LineIterator LineRange::end() { return m_device.line_end(); }
-
}
diff --git a/Userland/Libraries/LibCore/IODevice.h b/Userland/Libraries/LibCore/IODevice.h
index 8223f5d84f..d46e0fcd15 100644
--- a/Userland/Libraries/LibCore/IODevice.h
+++ b/Userland/Libraries/LibCore/IODevice.h
@@ -14,44 +14,6 @@
namespace Core {
-class IODevice;
-
-// This is not necessarily a valid iterator in all contexts,
-// if we had concepts, this would be InputIterator, not Copyable, Movable.
-class LineIterator {
- AK_MAKE_NONCOPYABLE(LineIterator);
-
-public:
- explicit LineIterator(IODevice&, bool is_end = false);
-
- bool operator==(LineIterator const& other) const { return &other == this || (at_end() && other.is_end()) || (other.at_end() && is_end()); }
- bool is_end() const { return m_is_end; }
- bool at_end() const;
-
- LineIterator& operator++();
-
- StringView operator*() const { return m_buffer; }
-
-private:
- NonnullRefPtr<IODevice> m_device;
- bool m_is_end { false };
- DeprecatedString m_buffer;
-};
-
-class LineRange {
-public:
- LineRange() = delete;
- explicit LineRange(IODevice& device)
- : m_device(device)
- {
- }
- LineIterator begin();
- LineIterator end();
-
-private:
- IODevice& m_device;
-};
-
enum class OpenMode : unsigned {
NotOpen = 0,
ReadOnly = 1,
@@ -101,13 +63,6 @@ public:
virtual bool open(OpenMode) = 0;
virtual bool close();
- LineIterator line_begin() & { return LineIterator(*this); }
- LineIterator line_end() { return LineIterator(*this, true); }
- LineRange lines()
- {
- return LineRange(*this);
- }
-
protected:
explicit IODevice(Object* parent = nullptr);