mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:17:45 +00:00
LibCore: Remove deprecated LineRange and LineIterator
This commit is contained in:
parent
f93ee3142d
commit
7e70ca1040
2 changed files with 0 additions and 68 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue