mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 14:47:35 +00:00
GIODevice: Add a read_all() that returns a ByteBuffer with all we can read.
Use this to implement file opening in TextEditor.
This commit is contained in:
parent
8e3d0a23d5
commit
9ad076178a
6 changed files with 58 additions and 25 deletions
|
@ -28,6 +28,7 @@ public:
|
|||
|
||||
ByteBuffer read(int max_size);
|
||||
ByteBuffer read_line(int max_size);
|
||||
ByteBuffer read_all();
|
||||
|
||||
// FIXME: I would like this to be const but currently it needs to call populate_read_buffer().
|
||||
bool can_read_line();
|
||||
|
@ -49,6 +50,7 @@ protected:
|
|||
|
||||
private:
|
||||
bool populate_read_buffer();
|
||||
bool can_read_from_fd() const;
|
||||
|
||||
int m_fd { -1 };
|
||||
int m_error { 0 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue