|  |  |  | GSF Reference Manual |  | 
|---|---|---|---|---|
| Top | Description | ||||
GsfBlob; GsfBlobClass; GsfStructuredBlob; GsfBlob * gsf_blob_new (gsize size,gconstpointer data_to_copy,GError **error); gsize gsf_blob_get_size (GsfBlob const *blob); gconstpointer gsf_blob_peek_data (GsfBlob const *blob); gboolean gsf_structured_blob_write (GsfStructuredBlob *blob,GsfOutfile *container); GsfStructuredBlob * gsf_structured_blob_read (GsfInput *input);
GsfBlob * gsf_blob_new (gsize size,gconstpointer data_to_copy,GError **error);
Creates a new GsfBlob 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.
| 
 | Size of the data in bytes. | 
| 
 | Data which will be copied into the blob, or NULLifsizeis zero. [in][array length=size][element-type guint8] | 
| 
 | location to store error, or NULL. | 
| Returns : | A newly-created GsfBlob, or NULLif the data could not be copied.
Error domain: GSF_ERROR
Possible errors: GSF_ERROR_OUT_OF_MEMORY if thedata_to_copycould not be copied. | 
gsize               gsf_blob_get_size                   (GsfBlob const *blob);
Queries the size in bytes of the data stored in the blob.
| 
 | A GsfBlob. | 
| Returns : | Size in bytes, or 0 if the data is NULL. | 
gconstpointer       gsf_blob_peek_data                  (GsfBlob const *blob);
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.
| 
 | A GsfBlob. | 
| Returns : | Pointer to the data stored in the
blob, or NULLif the size of the data is zero. [transfer none] | 
gboolean gsf_structured_blob_write (GsfStructuredBlob *blob,GsfOutfile *container);
Dumps structured blob blob onto the container.  Will fail if the output is
not an Outfile and blob has multiple streams.
| 
 | GsfStructuredBlob | 
| 
 | GsfOutfile | 
| Returns : | TRUEon success. | 
GsfStructuredBlob * gsf_structured_blob_read            (GsfInput *input);
Create a tree of binary blobs with unknown content from a GsfInput or GsfInfile and store it in a newly created GsfStructuredBlob.
| 
 | An input (potentially a GsfInfile) holding the blob | 
| Returns : | a new GsfStructuredBlob object which the caller is responsible for. [transfer full] |