GSF Reference Manual |
---|
Input from unstructured files —
struct GsfInput; GsfInfile* gsf_input_container (GsfInput *input); GsfInput* gsf_input_dup (GsfInput *input, GError **err); gsf_off_t gsf_input_size (GsfInput *input); gboolean gsf_input_eof (GsfInput *input); gsf_off_t gsf_input_remaining (GsfInput *input); gsf_off_t gsf_input_tell (GsfInput *input); gboolean gsf_input_seek (GsfInput *input, gsf_off_t offset, GSeekType whence); GQuark gsf_input_error (void); GsfInput* gsf_input_sibling (GsfInput const *input, char const *name, GError **err); gboolean gsf_input_copy (GsfInput *input, GsfOutput *output); GsfInput* gsf_input_uncompress (GsfInput *src); gboolean gsf_input_set_name (GsfInput *input, char const *name); gboolean gsf_input_set_container (GsfInput *input, GsfInfile *container); gboolean gsf_input_set_size (GsfInput *input, gsf_off_t size); gboolean gsf_input_seek_emulate (GsfInput *input, gsf_off_t pos);
GObject +----GsfInput +----GsfInfile +----GsfInputGZip +----GsfInputMemory +----GsfInputStdio +----GsfInputTextline
"eof" gboolean : Read "name" gchararray : Read "position" gint64 : Read "remaining" gint64 : Read "size" gint64 : Read
GsfInfile* gsf_input_container (GsfInput *input);
input : | |
Returns : | , but does not add a reference to input's container. Potentially NULL |
GsfInput* gsf_input_dup (GsfInput *input, GError **err);
Duplicates input src leaving the new one at the same offset.
input : | The input to duplicate |
err : | optionally NULL |
Returns : | : the duplicate, or NULL on error |
gsf_off_t gsf_input_size (GsfInput *input);
Looks up and caches the number of bytes in the input
input : | The input |
Returns : | : the size or -1 on error |
gboolean gsf_input_eof (GsfInput *input);
Are we at the end of the file ?
input : | the input |
Returns : | : TRUE if the input is at the eof. |
gsf_off_t gsf_input_remaining (GsfInput *input);
input : | |
Returns : | the number of bytes left in the file. |
gsf_off_t gsf_input_tell (GsfInput *input);
input : | |
Returns : | the current offset in the file. |
gboolean gsf_input_seek (GsfInput *input, gsf_off_t offset, GSeekType whence);
input : | |
offset : | |
whence : | |
Returns : | TRUE on error. |
GQuark gsf_input_error (void);
Returns : | : A utility quark to flag a GError as being an input problem. |
GsfInput* gsf_input_sibling (GsfInput const *input, char const *name, GError **err);
input : | |
name : | |
err : | |
Returns : |
gboolean gsf_input_copy (GsfInput *input, GsfOutput *output);
Copy the contents from input to output from their respective current positions. So if you want to be sure to copy *everything*, make sure to call gsf_input_seek (input, 0, G_SEEK_SET) and gsf_output_seek (output, 0, G_SEEK_SET) first, if applicable.
GsfInput* gsf_input_uncompress (GsfInput *src);
src : | stream to be uncompressed. |
Returns : | A stream equivalent to the source stream, but uncompressed if the source was compressed. This functions takes ownership of the incoming reference and yields a new one as its output. |
gboolean gsf_input_set_name (GsfInput *input, char const *name);
protected.
input : | |
name : | |
Returns : | : TRUE if the assignment was ok. |
gboolean gsf_input_set_container (GsfInput *input, GsfInfile *container);
input : | |
container : | |
Returns : | : TRUE if the assignment was ok. |
gboolean gsf_input_set_size (GsfInput *input, gsf_off_t size);
input : | |
size : | |
Returns : | : TRUE if the assignment was ok. |
<< Basic Input/Output | Output to unstructured files >> |