mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibCore: Remove unused API of deprecated Core::IODevice
This commit is contained in:
parent
7e70ca1040
commit
a467f78aa7
Notes:
sideshowbarker
2024-07-17 10:31:19 +09:00
Author: https://github.com/BenWiederhake Commit: https://github.com/SerenityOS/serenity/commit/a467f78aa7 Pull-request: https://github.com/SerenityOS/serenity/pull/18930 Reviewed-by: https://github.com/gmta ✅
2 changed files with 0 additions and 32 deletions
|
@ -110,11 +110,6 @@ bool IODevice::can_read_line() const
|
|||
}
|
||||
}
|
||||
|
||||
bool IODevice::can_read() const
|
||||
{
|
||||
return !m_buffered_data.is_empty() || can_read_from_fd();
|
||||
}
|
||||
|
||||
ByteBuffer IODevice::read_all()
|
||||
{
|
||||
off_t file_size = 0;
|
||||
|
@ -262,16 +257,6 @@ bool IODevice::seek(i64 offset, SeekMode mode, off_t* pos)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool IODevice::truncate(off_t size)
|
||||
{
|
||||
int rc = ftruncate(m_fd, size);
|
||||
if (rc < 0) {
|
||||
set_error(errno);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IODevice::write(u8 const* data, int size)
|
||||
{
|
||||
int rc = ::write(m_fd, data, size);
|
||||
|
@ -289,12 +274,6 @@ void IODevice::set_fd(int fd)
|
|||
return;
|
||||
|
||||
m_fd = fd;
|
||||
did_update_fd(fd);
|
||||
}
|
||||
|
||||
bool IODevice::write(StringView v)
|
||||
{
|
||||
return write((u8 const*)v.characters_without_null_termination(), v.length());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -34,14 +34,11 @@ public:
|
|||
|
||||
int fd() const { return m_fd; }
|
||||
OpenMode mode() const { return m_mode; }
|
||||
bool is_open() const { return m_mode != OpenMode::NotOpen; }
|
||||
bool eof() const { return m_eof; }
|
||||
|
||||
int error() const { return m_error; }
|
||||
char const* error_string() const;
|
||||
|
||||
bool has_error() const { return m_error != 0; }
|
||||
|
||||
int read(u8* buffer, int length);
|
||||
|
||||
ByteBuffer read(size_t max_size);
|
||||
|
@ -49,15 +46,9 @@ public:
|
|||
DeprecatedString read_line(size_t max_size = 16384);
|
||||
|
||||
bool write(u8 const*, int size);
|
||||
bool write(StringView);
|
||||
|
||||
bool truncate(off_t);
|
||||
|
||||
bool can_read_line() const;
|
||||
|
||||
bool can_read() const;
|
||||
bool can_read_only_from_buffer() const { return !m_buffered_data.is_empty() && !can_read_from_fd(); }
|
||||
|
||||
bool seek(i64, SeekMode = SeekMode::SetPosition, off_t* = nullptr);
|
||||
|
||||
virtual bool open(OpenMode) = 0;
|
||||
|
@ -71,8 +62,6 @@ protected:
|
|||
void set_error(int error) const { m_error = error; }
|
||||
void set_eof(bool eof) const { m_eof = eof; }
|
||||
|
||||
virtual void did_update_fd(int) { }
|
||||
|
||||
private:
|
||||
bool populate_read_buffer(size_t size = 1024) const;
|
||||
bool can_read_from_fd() const;
|
||||
|
|
Loading…
Reference in a new issue