Gsf.Output¶
| Subclasses: | Gsf.Outfile,Gsf.OutputBzip,Gsf.OutputCsv,Gsf.OutputGZip,Gsf.OutputGio,Gsf.OutputIOChannel,Gsf.OutputIconv,Gsf.OutputMemory,Gsf.OutputStdio | 
|---|
Methods¶
| Inherited: | GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| class | error_id() | 
| class | unwrap(wrapper, wrapee) | 
| class | wrap(wrapper, wrapee) | 
| close() | |
| container() | |
| error() | |
| get_modtime() | |
| is_closed() | |
| name() | |
| puts(line) | |
| seek(offset, whence) | |
| set_container(container) | |
| set_modtime(modtime) | |
| set_name(name) | |
| set_name_from_filename(filename) | |
| size() | |
| tell() | |
| write(data) | 
Properties¶
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| container | Gsf.Outfile | r/w | The parent Gsf.Outfile | 
| is-closed | bool | r | Whether the output is closed | 
| modtime | GLib.DateTime | r/w/co | An optional GLib.DateTimerepresenting the time the output was last changed | 
| name | str | r/w | The output’s name | 
| position | int | r | The output’s current position | 
| size | int | r | The output’s size | 
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
Fields¶
| Inherited: | GObject.Object (1) | 
|---|
| Name | Type | Access | Description | 
|---|---|---|---|
| cur_offset | int | r | |
| cur_size | int | r | |
| err | GLib.Error | r | |
| g_object | GObject.Object | r | |
| printf_buf | str | r | |
| printf_buf_size | int | r | |
| wrapped_by | GObject.Object | r | 
Class Details¶
- 
class Gsf.Output(**kwargs)¶
- Bases: - GObject.Object- Abstract: - Yes - Structure: - Gsf.OutputClass- Class representing an output stream, counterpart to - Gsf.Input.- 
classmethod unwrap(wrapper, wrapee)¶
- Parameters: - wrapper (GObject.Object) –
- wrapee (Gsf.Output) –
 - Returns: - Trueif the unwrapping succeeded.- Return type: 
- wrapper (
 - 
classmethod wrap(wrapper, wrapee)¶
- Parameters: - wrapper (GObject.Object) –
- wrapee (Gsf.Output) –
 - Returns: - Trueif the wrapping succeeded.- Return type: 
- wrapper (
 - 
container()¶
- Returns: - self’s container - Return type: - Gsf.Outfileor- None
 - 
error()¶
- Returns: - the last error logged on the output - Return type: - GLib.Erroror- None
 - 
get_modtime()¶
- Returns: - A - GLib.DateTimerepresenting when the output was last modified- Return type: - GLib.DateTimeor- None
 - 
puts(line)¶
- Parameters: - line ( - str) – Nul terminated string to write- Returns: - Trueif successful,- Falseif not- Return type: - bool- Like fputs, this assumes that the line already ends with a newline 
 - 
seek(offset, whence)¶
- Parameters: - offset (int) – Relative amount to reposition
- whence (GLib.SeekType) – What the offset is relative to.
 - Returns: - Falseon 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 to- fseek 3. 
- offset (
 - 
set_container(container)¶
- Parameters: - container ( - Gsf.Outfileor- None) –- Gsf.Outfile- Returns: - Trueif the assignment was ok.- Return type: - bool- This is a utility routine that should only be used by derived outputs. 
 - 
set_modtime(modtime)¶
- Parameters: - modtime ( - GLib.DateTimeor- None) – the new modification time.- Returns: - Trueif the assignment was ok.- Return type: - bool
 - 
set_name(name)¶
- Parameters: - name ( - stror- None) – the new name- Returns: - Trueif the assignment was ok.- Return type: - bool- This is a utility routine that should only be used by derived outputs. 
 - 
set_name_from_filename(filename)¶
- Parameters: - filename ( - stror- None) – the (fs-sys encoded) filename- Returns: - Trueif the assignment was ok.- Return type: - bool- 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: - int- Determine the size of the output stream self. 
 - 
tell()¶
- Returns: - the current position in the file - Return type: - int- Tell the current position in self, similar to - ftell 3. 
 - 
write(data)¶
- Parameters: - data ( - bytes) – Data to write.- Returns: - Falseon error.- Return type: - bool- Write num_bytes of data to self. 
 - 
do_Seek(offset, whence) virtual¶
- Parameters: - offset (int) – Relative amount to reposition
- whence (GLib.SeekType) – What the offset is relative to.
 - Returns: - Falseon 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 to- fseek 3. 
- offset (
 
- 
classmethod 
Property Details¶
- 
Gsf.Output.props.container¶
- Name: - container- Type: - Gsf.Outfile- Default Value: - None- Flags: - READABLE,- WRITABLE- The container, optionally - None, in which this output lives.
- 
Gsf.Output.props.is_closed¶
- Name: - is-closed- Type: - bool- Default Value: - False- Flags: - READABLE- Trueif the output has been closed.
- 
Gsf.Output.props.modtime¶
- Name: - modtime- Type: - GLib.DateTime- Default Value: - None- Flags: - READABLE,- WRITABLE,- 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 - Gsf.Outfilemember. Not all derived classes will actually do anything with this property.
- 
Gsf.Output.props.name¶
- Name: - name- Type: - str- Default Value: - None- Flags: - READABLE,- WRITABLE- The output’s name