1
Fork 0
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:
Andreas Kling 2019-03-18 14:38:30 +01:00
parent 8e3d0a23d5
commit 9ad076178a
6 changed files with 58 additions and 25 deletions

View file

@ -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 };