Class

PurpleCircularBuffer

Description

class Purple.CircularBuffer : GObject.Object {
  parent_instance: GObject
}
No description available.

Ancestors

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.

Instance methods

purple_circular_buffer_append

Append data to the PurpleCircularBuffer. This will grow the internal buffer to fit the added data, if needed.

purple_circular_buffer_get_grow_size

Returns the number of bytes by which the buffer grows when more space is needed.

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.

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.

purple_circular_buffer_get_used

Returns the number of bytes of this buffer that contain unread data.

purple_circular_buffer_grow

Increases the buffer size by a multiple of grow size, so that it can hold at least ‘len’ bytes.

purple_circular_buffer_mark_read

Mark the number of bytes that have been read from the buffer.

purple_circular_buffer_reset

Resets the buffer input and output pointers to the start of the buffer.

Methods inherited from GObject (43)

Please see GObject for a full list of methods.

Properties

Purple.CircularBuffer:buffer-used
No description available.
Purple.CircularBuffer:grow-size
No description available.
Purple.CircularBuffer:input
No description available.
Purple.CircularBuffer:output
No description available.

Signals

Signals inherited from GObject (1)
GObject.Object::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.

Purple.CircularBufferClass.grow

Increases the buffer size by a multiple of grow size, so that it can hold at least ‘len’ bytes.

Purple.CircularBufferClass.mark_read

Mark the number of bytes that have been read from the buffer.

Purple.CircularBufferClass.max_read_size
No description available.