Buffer
Object Hierarchy:
Description:
A data buffer, generally used to represent a chunk of a MessageBody.
data is a BusName because that's generally convenient; in some
situations you may need to cast it to uchar or another type.
Namespace: Soup
Package: libsoup-2.4
Content:
Creation methods:
-
public Buffer (MemoryUse use, uint8[] data)
Creates a new Buffer containing length bytes
from data.
-
public Buffer.subbuffer (Buffer parent, size_t offset, size_t length)
Creates a new Buffer containing length bytes
"copied" from parent starting at offset. (Normally this will not actually copy any data, but will instead
simply reference the same data as parent does.)
-
public Buffer.take (owned uint8[] data)
Creates a new Buffer containing length bytes
from data.
-
public Buffer.with_owner (uint8[] data, void* owner, DestroyNotify? owner_dnotify)
Creates a new Buffer containing length bytes
from data. When the Buffer is freed, it will call owner_dnotify
, passing owner to it. You must ensure that data will remain valid until owner_dnotify is
called.
Methods:
-
public Buffer copy ()
Makes a copy of buffer. In reality, Buffer is
a refcounted type, and calling copy will normally just increment the refcount on
buffer and return it. However, if buffer was created with
TEMPORARY memory, then
copy will actually return a copy of it, so that the data in the copy will remain valid after the temporary buffer is freed.
-
public void free ()
Frees buffer. (In reality, as described in the documentation for
copy, this is actually an "unref" operation, and may or may not actually free
buffer.)
-
public void get_data (out uint8[] data)
This function exists for use by language bindings, because it's not currently possible to get the right
effect by annotating the fields of Buffer.
-
public void* get_owner ()
Fields: