![]() |
![]() |
![]() |
GSF Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
GsfOutput; 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
,...
); gsf_off_t gsf_output_vprintf (GsfOutput *output
,char const *format
,va_list args
); GsfOutfile * gsf_output_container (GsfOutput const *output
); char const * gsf_output_name (GsfOutput const *output
); gboolean gsf_output_set_name_from_filename (GsfOutput *output
,char const *filename
); GQuark gsf_output_error_id (void
); gboolean gsf_output_set_error (GsfOutput *output
,gint code
,char const *format
,...
); GError const * gsf_output_error (GsfOutput const *output
); gboolean gsf_output_is_closed (GsfOutput const *output
); gboolean gsf_output_wrap (GObject *wrapper
,GsfOutput *wrapee
); gboolean gsf_output_unwrap (GObject *wrapper
,GsfOutput *wrapee
);
GObject +----GsfOutput +----GsfOutfile +----GsfOutputBzip +----GsfOutputCsv +----GsfOutputGZip +----GsfOutputIconv +----GsfOutputIOChannel +----GsfOutputMemory +----GsfOutputStdio
"container" GsfOutfile* : Read / Write "is-closed" gboolean : Read "modtime" GDateTime* : Read / Write / Construct Only "name" gchar* : Read / Write "position" gint64 : Read "size" gint64 : Read
typedef struct _GsfOutput GsfOutput;
Class representing an output stream, counterpart to GsfInput.
gsf_off_t gsf_output_size (GsfOutput *output
);
Determine the size of the output stream output
.
|
GsfOutput |
Returns : |
the size of the output, or -1 if it does not have a size. |
gsf_off_t gsf_output_tell (GsfOutput *output
);
Tell the current position in output
, similar to
ftell(3).
|
GsfOutput |
Returns : |
the current position in the file |
gboolean gsf_output_seek (GsfOutput *output
,gsf_off_t offset
,GSeekType whence
);
Reposition in output stream output
. whence
specifies what the offset is
relative to: the beginning of the stream (G_SEEK_SET
), current position in
the stream (G_SEEK_CUR
) or the end of the stream (G_SEEK_END
).
This function is similar to
fseek(3).
gboolean gsf_output_write (GsfOutput *output
,size_t num_bytes
,guint8 const *data
);
Write num_bytes
of data
to output
.
|
Output stream |
|
Number of bytes to write |
|
Data to write. [in][array length=num_bytes] |
Returns : |
FALSE on error. |
gboolean gsf_output_puts (GsfOutput *output
,char const *line
);
Like fputs, this assumes that the line already ends with a newline
gboolean gsf_output_printf (GsfOutput *output
,char const *format
,...
);
Output Varargs
to output
using the format string format
, similar to
printf(3).
gsf_off_t gsf_output_vprintf (GsfOutput *output
,char const *format
,va_list args
);
Output args
to output
using the format string format
, similar to
vprintf(3).
|
A GsfOutput |
|
The printf-style format string |
|
the arguments for format
|
Returns : |
number of bytes printed, a negative value if not successful |
GsfOutfile * gsf_output_container (GsfOutput const *output
);
Returns : |
output 's container, potentially NULL . [transfer none]
|
char const * gsf_output_name (GsfOutput const *output
);
Give the name of output
.
|
GsfOutput |
Returns : |
output 's name in utf8 form. [transfer none]
|
gboolean gsf_output_set_name_from_filename (GsfOutput *output
,char const *filename
);
|
the output stream |
|
the (fs-sys encoded) filename |
Returns : |
TRUE if the assignment was ok. |
gboolean gsf_output_set_error (GsfOutput *output
,gint code
,char const *format
,...
);
GError const * gsf_output_error (GsfOutput const *output
);
Returns : |
the last error logged on the output, or NULL . [transfer none]
|
gboolean gsf_output_wrap (GObject *wrapper
,GsfOutput *wrapee
);
Returns : |
TRUE if the wrapping succeeded. |
"container"
property"container" GsfOutfile* : Read / Write
The container, optionally NULL
, in which this output lives.
"is-closed"
property"is-closed" gboolean : Read
TRUE
if the output has been closed.
Default value: FALSE
"modtime"
property"modtime" GDateTime* : Read / Write / Construct Only
The time the output was last updated. This must be set on object construction and represents the timestamp to put on the resulting file or GsfOutfile member. Not all derived classes will actually do anything with this property.
"position"
property "position" gint64 : Read
The current position in the output.
Allowed values: >= 0
Default value: 0