Class
PurpleCircularBuffer
unstable since: 3.0
Description [src]
class Purple.CircularBuffer : GObject.Object
{
/* No available fields */
}
A circular buffer implementation.
Available since: 3.0
Constructors
purple_circular_buffer_new
Creates a new circular buffer. This will not allocate any memory for the actual buffer until data is appended to it.
unstable since: 3.0
Instance methods
purple_circular_buffer_append
Append data to the PurpleCircularBuffer. This will grow the internal buffer to fit the added data, if needed.
unstable since: 3.0
purple_circular_buffer_get_grow_size
Returns the number of bytes by which the buffer grows when more space is needed.
unstable since: 3.0
purple_circular_buffer_get_max_read
Determine the maximum number of contiguous bytes that can be read from the
PurpleCircularBuffer.
Note: This may not be the total number of bytes that are buffered - a
subsequent call after calling purple_circular_buffer_mark_read()
may indicate
more data is available to read.
unstable since: 3.0
purple_circular_buffer_get_output
Returns the output pointer of the buffer, where unread data is available.
Use purple_circular_buffer_get_max_read()
to determine the number of
contiguous bytes that can be read from this output. After reading the data,
call purple_circular_buffer_mark_read()
to mark the retrieved data as read.
unstable since: 3.0
purple_circular_buffer_get_used
Returns the number of bytes of this buffer that contain unread data.
unstable since: 3.0
purple_circular_buffer_grow
Increases the buffer size by a multiple of grow size, so that it can hold at least ‘len’ bytes.
unstable since: 3.0
purple_circular_buffer_mark_read
Mark the number of bytes that have been read from the buffer.
unstable since: 3.0
purple_circular_buffer_reset
Resets the buffer input and output pointers to the start of the buffer.
unstable since: 3.0
Signals
Signals inherited from GObject (1)
GObject::notify
The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.
Class structure
struct PurpleCircularBufferClass {
void (* grow) (
PurpleCircularBuffer* buffer,
gsize len
);
void (* append) (
PurpleCircularBuffer* buffer,
gconstpointer src,
gsize len
);
gsize (* max_read_size) (
PurpleCircularBuffer* buffer
);
gboolean (* mark_read) (
PurpleCircularBuffer* buffer,
gsize len
);
void (* purple_reserved1) (
void
);
void (* purple_reserved2) (
void
);
void (* purple_reserved3) (
void
);
void (* purple_reserved4) (
void
);
}
No description available.
Class members
grow: void (* grow) ( PurpleCircularBuffer* buffer, gsize len )
No description available.
append: void (* append) ( PurpleCircularBuffer* buffer, gconstpointer src, gsize len )
No description available.
max_read_size: gsize (* max_read_size) ( PurpleCircularBuffer* buffer )
No description available.
mark_read: gboolean (* mark_read) ( PurpleCircularBuffer* buffer, gsize len )
No description available.
purple_reserved1: void (* purple_reserved1) ( void )
No description available.
purple_reserved2: void (* purple_reserved2) ( void )
No description available.
purple_reserved3: void (* purple_reserved3) ( void )
No description available.
purple_reserved4: void (* purple_reserved4) ( void )
No description available.
Virtual methods
Purple.CircularBufferClass.append
Append data to the PurpleCircularBuffer. This will grow the internal buffer to fit the added data, if needed.
unstable since: 3.0
Purple.CircularBufferClass.grow
Increases the buffer size by a multiple of grow size, so that it can hold at least ‘len’ bytes.
unstable since: 3.0
Purple.CircularBufferClass.mark_read
Mark the number of bytes that have been read from the buffer.
unstable since: 3.0