Top | ![]() |
![]() |
![]() |
![]() |
BonoboStreamMem * | bonobo_stream_mem_construct () |
BonoboObject * | bonobo_stream_mem_create () |
const char * | bonobo_stream_mem_get_buffer () |
size_t | bonobo_stream_mem_get_size () |
BonoboStreamMem * bonobo_stream_mem_construct (BonoboStreamMem *stream_mem
,const char *buffer
,size_t size
,gboolean read_only
,gboolean resizable
);
BonoboObject * bonobo_stream_mem_create (const char *buffer
,size_t size
,gboolean read_only
,gboolean resizable
);
Creates a new BonoboStreamMem object.
If buffer
is non-NULL
, size
bytes are copied from it into a new
buffer. If buffer
is NULL
, a new buffer of size size
is created
and filled with zero bytes.
When data is read out of or (if read_only
is FALSE) written into
the returned BonoboStream object, the read()
and write()
operations
operate on the new buffer. If resizable
is TRUE, writing or seeking
past the end of the buffer will cause the buffer to be expanded (with
the new space zero-filled for a seek).
const char *
bonobo_stream_mem_get_buffer (BonoboStreamMem *stream_mem
);
Returns the buffer associated with a BonoboStreamMem. If the stream is set to automatically resize itself, this buffer is only guaranteed to stay valid until the next write operation on the stream.
size_t
bonobo_stream_mem_get_size (BonoboStreamMem *stream_mem
);
Returns the size of the data associated with a BonoboStreamMem see bonobo_stream_mem_get_buffer