Gda.BlobOp

g GObject.Object GObject.Object Gda.BlobOp Gda.BlobOp GObject.Object->Gda.BlobOp

Subclasses:None

Methods

Inherited:GObject.Object (37)
Structs:GObject.ObjectClass (5)
  get_length ()
  read (blob, offset, size)
  read_all (blob)
  write (blob, offset)
  write_all (blob)

Virtual Methods

Inherited:GObject.Object (7)
  do_get_length ()
  do_read (blob, offset, size)
  do_write (blob, offset)
  do_write_all (blob)

Properties

None

Signals

Inherited:GObject.Object (1)

Fields

Inherited:GObject.Object (1)
Name Type Access Description
object GObject.Object r  

Class Details

class Gda.BlobOp(**kwargs)
Bases:GObject.Object
Abstract:Yes
Structure:Gda.BlobOpClass
get_length()
Returns:the length of the blob in bytes. In case of error, -1 is returned and the provider should have added an error (a Gda.ConnectionEvent) to the connection.
Return type:int
read(blob, offset, size)
Parameters:
  • blob (Gda.Blob) – a Gda.Blob to read data to
  • offset (int) – offset to read from the start of the blob (starts at 0)
  • size (int) – maximum number of bytes to read.
Returns:

the number of bytes actually read. In case of error, -1 is returned and the provider should have added an error to the connection.

Return type:

int

Reads a chunk of bytes from the BLOB accessible through self into blob.

read_all(blob)
Parameters:blob (Gda.Blob) – a Gda.Blob to read data to
Returns:True if blob->data contains the whole BLOB manipulated by self
Return type:bool

Reads the whole contents of the blob manipulated by self into blob

write(blob, offset)
Parameters:
  • blob (Gda.Blob) – a Gda.Blob which contains the data to write
  • offset (int) – offset to write from the start of the blob (starts at 0)
Returns:

the number of bytes written. In case of error, -1 is returned and the provider should have added an error to the connection.

Return type:

int

Writes a chunk of bytes from a blob to the BLOB accessible through self, blob is unchanged after this call.

If blob has an associated Gda.BlobOp (ie. if blob->op is not None) then the data to be written using self is the data fetched using blob->op.

write_all(blob)
Parameters:blob (Gda.Blob) – a Gda.Blob which contains the data to write
Returns:True on success
Return type:bool

Writes the whole contents of blob into the blob manipulated by self. If necessary the resulting blob is truncated from its previous length.

do_get_length() virtual
Returns:the length of the blob in bytes. In case of error, -1 is returned and the provider should have added an error (a Gda.ConnectionEvent) to the connection.
Return type:int
do_read(blob, offset, size) virtual
Parameters:
  • blob (Gda.Blob) – a Gda.Blob to read data to
  • offset (int) – offset to read from the start of the blob (starts at 0)
  • size (int) – maximum number of bytes to read.
Returns:

the number of bytes actually read. In case of error, -1 is returned and the provider should have added an error to the connection.

Return type:

int

Reads a chunk of bytes from the BLOB accessible through op into blob.

do_write(blob, offset) virtual
Parameters:
  • blob (Gda.Blob) – a Gda.Blob which contains the data to write
  • offset (int) – offset to write from the start of the blob (starts at 0)
Returns:

the number of bytes written. In case of error, -1 is returned and the provider should have added an error to the connection.

Return type:

int

Writes a chunk of bytes from a blob to the BLOB accessible through op, blob is unchanged after this call.

If blob has an associated Gda.BlobOp (ie. if blob->op is not None) then the data to be written using op is the data fetched using blob->op.

do_write_all(blob) virtual
Parameters:blob (Gda.Blob) – a Gda.Blob which contains the data to write
Returns:True on success
Return type:bool

Writes the whole contents of blob into the blob manipulated by op. If necessary the resulting blob is truncated from its previous length.