Efl.Io.Reader (interface)

Description

Generic interface for objects that can read data into a provided memory.

This interface allows external objects to transparently monitor for new data and as it to be read into a provided memory slice.

Calls to Efl.Io.Reader.read may or may not block, that's not up to this interface to specify. The user can check based on Efl.Io.Reader.eos property and signal if the stream reached an end, with event "can_read,changed" or property Efl.Io.Reader.can_read to known whenever a read would have data to return.

Since 1.22

Members

can_read (get, set) protected set

If true will notify Efl.Io.Reader.read can be called without blocking or failing.
Eina_Bool efl_io_reader_can_read_get(const Eo *obj);
void efl_io_reader_can_read_set(Eo *obj, Eina_Bool can_read);


eos (get, set) protected set

If true will notify end of stream.
Eina_Bool efl_io_reader_eos_get(const Eo *obj);
void efl_io_reader_eos_set(Eo *obj, Eina_Bool is_eos);


read

Reads data into a pre-allocated buffer.
Eina_Error efl_io_reader_read(Eo *obj, Eina_Rw_Slice rw_slice);


Events

can_read,changed

Notifies can_read property changed.
EFL_IO_READER_EVENT_CAN_READ_CHANGED(Eina_Bool)


eos

Notifies end of stream, when property is marked as true.
EFL_IO_READER_EVENT_EOS(void)