Gsf.Blob

g GObject.Object GObject.Object Gsf.Blob Gsf.Blob GObject.Object->Gsf.Blob

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (data_to_copy)

get_size ()

peek_data ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

object

GObject.Object

r

Class Details

class Gsf.Blob(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Gsf.BlobClass

classmethod new(data_to_copy)
Parameters:

data_to_copy (bytes) – Data which will be copied into the blob, or None if size is zero.

Raises:

GLib.Error

Returns:

A newly-created Gsf.Blob, or None if the data could not be copied.

Error domain: #GSF_ERROR

Possible errors: Gsf.Error.OUT_OF_MEMORY if the data_to_copy could not be copied.

Return type:

Gsf.Blob

Creates a new Gsf.Blob object to hold the specified data. The blob can then be used as a facility for reference-counting for the data. The data is copied internally, so the blob does not hold references to external chunks of memory.

get_size()
Returns:

Size in bytes, or 0 if the data is None.

Return type:

int

Queries the size in bytes of the data stored in the blob.

peek_data()
Returns:

Pointer to the data stored in the blob, or None if the size of the data is zero.

Return type:

object or None

Queries a pointer to the data stored in the blob. This does not copy the data for you; it returns a pointer to the actual buffer which the blob uses internally, so you should not free this buffer on your own.