Gsf.Output¶
- Subclasses:
Gsf.Outfile
,Gsf.OutputBzip
,Gsf.OutputCsv
,Gsf.OutputGZip
,Gsf.OutputGio
,Gsf.OutputIOChannel
,Gsf.OutputIconv
,Gsf.OutputMemory
,Gsf.OutputStdio
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
The parent |
||
r |
Whether the output is closed |
||
r/w/co |
An optional |
||
r/w |
The output’s name |
||
r |
The output’s current position |
||
r |
The output’s size |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
cur_offset |
r |
||
cur_size |
r |
||
err |
r |
||
g_object |
r |
||
printf_buf |
r |
||
printf_buf_size |
r |
||
wrapped_by |
r |
Class Details¶
- class Gsf.Output(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
Class representing an output stream, counterpart to
Gsf.Input
.- classmethod unwrap(wrapper, wrapee)¶
- Parameters:
wrapper (
GObject.Object
) –wrapee (
Gsf.Output
) –
- Returns:
True
if the unwrapping succeeded.- Return type:
- classmethod wrap(wrapper, wrapee)¶
- Parameters:
wrapper (
GObject.Object
) –wrapee (
Gsf.Output
) –
- Returns:
True
if the wrapping succeeded.- Return type:
- container()¶
- Returns:
self's container
- Return type:
Gsf.Outfile
orNone
- error()¶
- Returns:
the last error logged on the output
- Return type:
GLib.Error
orNone
- get_modtime()¶
- Returns:
A
GLib.DateTime
representing when the output was last modified- Return type:
- puts(line)¶
- Parameters:
line (
str
) – Nul terminated string to write- Returns:
- Return type:
Like fputs, this assumes that the line already ends with a newline
- seek(offset, whence)¶
- Parameters:
offset (
int
) – Relative amount to repositionwhence (
GLib.SeekType
) – What the offset is relative to.
- Returns:
False
on error.- Return type:
Reposition in output stream self. whence specifies what the offset is relative to: the beginning of the stream (
GLib.SeekType.SET
), current position in the stream (GLib.SeekType.CUR
) or the end of the stream (GLib.SeekType.END
). This function is similar tofseek 3.
- set_container(container)¶
- Parameters:
container (
Gsf.Outfile
orNone
) –Gsf.Outfile
- Returns:
True
if the assignment was ok.- Return type:
This is a utility routine that should only be used by derived outputs.
- set_modtime(modtime)¶
- Parameters:
modtime (
GLib.DateTime
orNone
) – the new modification time.- Returns:
True
if the assignment was ok.- Return type:
- set_name(name)¶
- Parameters:
- Returns:
True
if the assignment was ok.- Return type:
This is a utility routine that should only be used by derived outputs.
- set_name_from_filename(filename)¶
- Parameters:
- Returns:
True
if the assignment was ok.- Return type:
This is a utility routine that should only be used by derived outputs.
- size()¶
- Returns:
the size of the output, or -1 if it does not have a size.
- Return type:
Determine the size of the output stream self.
- tell()¶
- Returns:
the current position in the file
- Return type:
Tell the current position in self, similar to
ftell 3.
- write(data)¶
-
Write num_bytes of data to self.
- do_Seek(offset, whence) virtual¶
- Parameters:
offset (
int
) – Relative amount to repositionwhence (
GLib.SeekType
) – What the offset is relative to.
- Returns:
False
on error.- Return type:
Reposition in output stream output. whence specifies what the offset is relative to: the beginning of the stream (
GLib.SeekType.SET
), current position in the stream (GLib.SeekType.CUR
) or the end of the stream (GLib.SeekType.END
). This function is similar tofseek 3.
Property Details¶
- Gsf.Output.props.container¶
- Name:
container
- Type:
- Default Value:
- Flags:
The container, optionally
None
, in which this output lives.
- Gsf.Output.props.modtime¶
- Name:
modtime
- Type:
- Default Value:
- Flags:
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
Gsf.Outfile
member. Not all derived classes will actually do anything with this property.
- Gsf.Output.props.name¶
-
The output’s name
- Gsf.Output.props.position¶
-
The current position in the output.