Efl.Io.Buffer (class)

Description

Generic In-memory buffer of data to be used as I/O.

This class offers both input and output, which can be used at the same time since Efl.Io.Reader.read and Efl.Io.Writer.write use different offsets/position internally.

One can get temporary direct access to internal buffer with Efl.Io.Buffer.slice or steal the buffer with Efl.Io.Buffer.binbuf_steal.

A fixed sized buffer can be implemented by setting Efl.Io.Buffer.limit followed by Efl.Io.Buffer.preallocate

Since 1.19

Inheritance

Efl.Object (class)

Full hierarchy

Members

adopt_readonly

Adopt a read-only slice as buffer's backing store.
void efl_io_buffer_adopt_readonly(Eo *obj, const Eina_Slice slice);


adopt_readwrite

Adopt a read-write slice as buffer's backing store.
void efl_io_buffer_adopt_readwrite(Eo *obj, Eina_Rw_Slice slice);


binbuf_steal

Steals the internal buffer memory and returns it as a binbuf.
Eina_Binbuf *efl_io_buffer_binbuf_steal(Eo *obj);


can_read (get, set) protected set [Overridden from Efl.Io.Reader]

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);


can_write (get, set) protected set [Overridden from Efl.Io.Writer]

If true will notify Efl.Io.Writer.write can be called without blocking or failing.
Eina_Bool efl_io_writer_can_write_get(const Eo *obj);
void efl_io_writer_can_write_set(Eo *obj, Eina_Bool can_write);


close [Overridden from Efl.Io.Closer]

Closes the Input/Output object.
Eina_Error efl_io_closer_close(Eo *obj);


close_on_destructor (get, set) [Overridden from Efl.Io.Closer]

If true will automatically close() on object destructor.
Eina_Bool efl_io_closer_close_on_destructor_get(const Eo *obj);
void efl_io_closer_close_on_destructor_set(Eo *obj, Eina_Bool close_on_destructor);


close_on_exec (get, set) [Overridden from Efl.Io.Closer]

If true will automatically close resources on exec() calls.
Eina_Bool efl_io_closer_close_on_exec_get(const Eo *obj);
Eina_Bool efl_io_closer_close_on_exec_set(Eo *obj, Eina_Bool close_on_exec);


closed (get, set) [Overridden from Efl.Io.Closer]

If true will notify object was closed.
Eina_Bool efl_io_closer_closed_get(const Eo *obj);
Eina_Bool efl_io_closer_closed_set(Eo *obj, Eina_Bool is_closed);


destructor [Overridden from Efl.Object]

Call the object's destructor.
void efl_destructor(Eo *obj);


eos (get, set) protected set [Overridden from Efl.Io.Reader]

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);


finalize [Overridden from Efl.Object]

Called at the end of efl_add. Should not be called, just overridden.
Efl_Object *efl_finalize(Eo *obj);


limit (get, set)

Limit how big the buffer can grow.
size_t efl_io_buffer_limit_get(const Eo *obj);
void efl_io_buffer_limit_set(Eo *obj, size_t size);


position (get, set) [Overridden from Efl.Io.Positioner]

Position property
uint64_t efl_io_positioner_position_get(const Eo *obj);
Eina_Bool efl_io_positioner_position_set(Eo *obj, uint64_t position);


position_read (get, set)

The position used by Efl.Io.Reader.read.
uint64_t efl_io_buffer_position_read_get(const Eo *obj);
Eina_Bool efl_io_buffer_position_read_set(Eo *obj, uint64_t position);


position_write (get, set)

The position used by Efl.Io.Writer.write.
uint64_t efl_io_buffer_position_write_get(const Eo *obj);
Eina_Bool efl_io_buffer_position_write_set(Eo *obj, uint64_t position);


preallocate

Immediately pre-allocate a buffer of at least a given size.
void efl_io_buffer_preallocate(Eo *obj, size_t size);


read [Overridden from Efl.Io.Reader]

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


resize [Overridden from Efl.Io.Sizer]

Resize object
Eina_Error efl_io_sizer_resize(Eo *obj, uint64_t size);


seek [Overridden from Efl.Io.Positioner]

Seek in data
Eina_Error efl_io_positioner_seek(Eo *obj, int64_t offset, Efl_Io_Positioner_Whence whence);


size (get, set) [Overridden from Efl.Io.Sizer]

Size property
uint64_t efl_io_sizer_size_get(const Eo *obj);
Eina_Bool efl_io_sizer_size_set(Eo *obj, uint64_t size);


slice (get)

Get a temporary access to buffer's internal memory.
Eina_Slice efl_io_buffer_slice_get(const Eo *obj);


write [Overridden from Efl.Io.Writer]

Writes data from a pre-populated buffer.
Eina_Error efl_io_writer_write(Eo *obj, Eina_Slice slice, Eina_Slice *remaining);


Inherited

Efl.Object
allow_parent_unref (get, set) Allow an object to be deleted by unref even if it has a parent.
children_iterator_new Get an iterator on all childrens
comment (get, set) A human readable comment for the object
composite_attach Make an object a composite object of another.
composite_detach Detach a composite object from another object.
composite_part_is Check if an object is part of a composite object.
constructor Call the object's constructor.
debug_name_override Build a read-only name for this object used for debugging.
del Unrefs the object and reparents it to NULL.
event_callback_forwarder_add Add an event callback forwarder for an event and an object.
event_callback_forwarder_del Remove an event callback forwarder for an event and an object.
event_callback_stop Stop the current callback call.
event_freeze Freeze events of object.
event_freeze_count (get) Return freeze events of object.
class event_global_freeze Freeze events of object.
class event_global_freeze_count (get) Return freeze events of object.
class event_global_thaw Thaw events of object.
event_thaw Thaw events of object.
finalized (get) True if the object is already finalized, otherwise false.
name (get, set) The name of the object.
name_find Find a child object with the given name and return it.
parent (get, set) The parent of an object.
provider_find Searches upwards in the object tree for a provider which knows the given class/interface.

Events

Inherited

Efl.Io.Closer
closed Notifies closed, when property is marked as true
Efl.Io.Positioner
position,changed Notifies position changed
Efl.Io.Reader
can_read,changed Notifies can_read property changed.
eos Notifies end of stream, when property is marked as true.
Efl.Io.Sizer
size,changed Notifies size changed
Efl.Io.Writer
can_write,changed Notifies can_write property changed.
Efl.Object
callback,add A callback was added.
callback,del A callback was deleted.
del Object is being deleted.
destruct Object has been fully destroyed. It can not be used beyond this point. This event should only serve to clean up any dangling pointer.