Output to unstructured files

Output to unstructured files —

Synopsis




struct      GsfOutput;
GsfOutfile* gsf_output_container            (GsfOutput const *output);
gsf_off_t   gsf_output_size                 (GsfOutput *output);
gboolean    gsf_output_close                (GsfOutput *output);
gsf_off_t   gsf_output_tell                 (GsfOutput *output);
gboolean    gsf_output_seek                 (GsfOutput *output,
                                             gsf_off_t offset,
                                             GSeekType whence);
gboolean    gsf_output_write                (GsfOutput *output,
                                             size_t num_bytes,
                                             guint8 const *data);
gboolean    gsf_output_puts                 (GsfOutput *output,
                                             char const *line);
gboolean    gsf_output_printf               (GsfOutput *output,
                                             char const *format,
                                             ...);
gboolean    gsf_output_is_closed            (GsfOutput const *output);
GQuark      gsf_output_error_id             (void);
gboolean    gsf_output_set_error            (GsfOutput *output,
                                             gint code,
                                             char const *format,
                                             ...);
gboolean    gsf_output_wrap                 (GObject *wrapper,
                                             GsfOutput *wrapee);
gboolean    gsf_output_unwrap               (GObject *wrapper,
                                             GsfOutput *wrapee);

gboolean    gsf_output_set_name             (GsfOutput *output,
                                             char const *name);
gboolean    gsf_output_set_container        (GsfOutput *output,
                                             GsfOutfile *container);

Object Hierarchy


  GObject
   +----GsfOutput
         +----GsfOutfile
         +----GsfOutputBzip
         +----GsfOutputIOChannel
         +----GsfOutputMemory
         +----GsfOutputStdio

Properties


  "is-closed"            gboolean              : Read
  "name"                 gchararray            : Read
  "position"             gint64                : Read
  "size"                 gint64                : Read

Description

Details

struct GsfOutput

struct GsfOutput;


gsf_output_container ()

GsfOutfile* gsf_output_container            (GsfOutput const *output);

output :
Returns :, but does not add a reference to output's container. Potentially NULL

gsf_output_size ()

gsf_off_t   gsf_output_size                 (GsfOutput *output);

output :
Returns :the size of the output, or -1 if it does not have a size.

gsf_output_close ()

gboolean    gsf_output_close                (GsfOutput *output);

Close a stream.

output :
Returns :FALSE on error

gsf_output_tell ()

gsf_off_t   gsf_output_tell                 (GsfOutput *output);

output :
Returns :the current position in the file

gsf_output_seek ()

gboolean    gsf_output_seek                 (GsfOutput *output,
                                             gsf_off_t offset,
                                             GSeekType whence);

output :
offset :
whence :
Returns :FALSE on error.

gsf_output_write ()

gboolean    gsf_output_write                (GsfOutput *output,
                                             size_t num_bytes,
                                             guint8 const *data);

output :
num_bytes :
data :
Returns :FALSE on error.

gsf_output_puts ()

gboolean    gsf_output_puts                 (GsfOutput *output,
                                             char const *line);

Like fputs, this assumes that the line already ends with a newline

output : A GsfOutput
line : null terminated string to write
Returns : TRUE if successful, FALSE if not

gsf_output_printf ()

gboolean    gsf_output_printf               (GsfOutput *output,
                                             char const *format,
                                             ...);

output : A GsfOutput
format : The printf-style format string
... : the arguments for format
Returns : TRUE if successful, FALSE if not

gsf_output_is_closed ()

gboolean    gsf_output_is_closed            (GsfOutput const *output);

output :
Returns :TRUE if output has already been closed.

gsf_output_error_id ()

GQuark      gsf_output_error_id             (void);

Returns :

gsf_output_set_error ()

gboolean    gsf_output_set_error            (GsfOutput *output,
                                             gint code,
                                             char const *format,
                                             ...);

Note

This is a utility routine that should only be used by derived outputs.

output :
code :
format :
... :
Returns :Always returns FALSE to facilitate its use.

gsf_output_wrap ()

gboolean    gsf_output_wrap                 (GObject *wrapper,
                                             GsfOutput *wrapee);

wrapper :
wrapee :
Returns :TRUE if the wrapping succeeded.

gsf_output_unwrap ()

gboolean    gsf_output_unwrap               (GObject *wrapper,
                                             GsfOutput *wrapee);

wrapper :
wrapee :
Returns :TRUE if the unwrapping succeeded.

gsf_output_set_name ()

gboolean    gsf_output_set_name             (GsfOutput *output,
                                             char const *name);

Note

This is a utility routine that should only be used by derived outputs.

output :
name :
Returns :: TRUE if the assignment was ok.

gsf_output_set_container ()

gboolean    gsf_output_set_container        (GsfOutput *output,
                                             GsfOutfile *container);

Note

This is a utility routine that should only be used by derived outputs.

output :
container :
Returns :: TRUE if the assignment was ok.

Properties

The "is-closed" property

  "is-closed"            gboolean              : Read

Whether the Output is Closed.

Default value: FALSE


The "name" property

  "name"                 gchararray            : Read

The Output's Name.

Default value: NULL


The "position" property

  "position"             gint64                : Read

The Output's Current Position.

Allowed values: >= 0

Default value: 0


The "size" property

  "size"                 gint64                : Read

The Output's Size.

Allowed values: >= 0

Default value: 0