Gsf.Input¶
| Subclasses: | Gsf.Infile,Gsf.InputGZip,Gsf.InputGio,Gsf.InputHTTP,Gsf.InputMemory,Gsf.InputProxy,Gsf.InputStdio,Gsf.InputTextline | 
|---|
Methods¶
| Inherited: | GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| class | error_id() | 
| class | mmap_new(filename) | 
| container() | |
| copy(output) | |
| dump(dump_as_hex) | |
| dup() | |
| eof() | |
| find_vba() | |
| get_modtime() | |
| name() | |
| read(num_bytes) | |
| remaining() | |
| seek(offset, whence) | |
| seek_emulate(pos) | |
| set_container(container) | |
| set_modtime(modtime) | |
| set_modtime_from_stat(st) | |
| set_name(name) | |
| set_name_from_filename(filename) | |
| set_size(size) | |
| sibling(name) | |
| size() | |
| tell() | |
| uncompress() | 
Virtual Methods¶
| Inherited: | GObject.Object (7) | 
|---|
| do_Dup() | |
| do_OpenSibling(name) | |
| do_Seek(offset, whence) | 
Properties¶
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| container | Gsf.Infile | r | The parent Gsf.Infile | 
| eof | bool | r | End of file | 
| modtime | GLib.DateTime | r | An optional GLib.DateTimerepresenting the time the input was last changed | 
| name | str | r | The input’s name | 
| position | int | r | The input’s current position | 
| remaining | int | r | Amount of data remaining | 
| size | int | r | The input’s size | 
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
Fields¶
| Inherited: | GObject.Object (1) | 
|---|
| Name | Type | Access | Description | 
|---|---|---|---|
| cur_offset | int | r | |
| g_object | GObject.Object | r | 
Class Details¶
- 
class Gsf.Input(**kwargs)¶
- Bases: - GObject.Object- Abstract: - Yes - Structure: - Gsf.InputClass- Class representing an input stream. - 
classmethod error_id()¶
- Returns: - A utility quark to flag a - GLib.Erroras being an input problem.- Return type: - int
 - 
classmethod mmap_new(filename)¶
- Parameters: - filename ( - str) – The file on disk that you want to mmap- Raises: - GLib.Error- Returns: - A new - Gsf.InputMemory- Return type: - Gsf.Input
 - 
container()¶
- Returns: - self’s container - Return type: - Gsf.Infileor- None
 - 
copy(output)¶
- Parameters: - output ( - Gsf.Output) – a non-null- Gsf.Output- Returns: - Trueon success- Return type: - bool- Copy the contents from self 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,- GLib.SeekType.SET) and- Gsf.Output.seek(output, 0,- GLib.SeekType.SET) first, if applicable.
 - 
dump(dump_as_hex)¶
- Parameters: - dump_as_hex ( - bool) – If- True, dump in hexidecmal format- Dumps self’s contents to STDOUT, optionally in hex format. 
 - 
dup()¶
- Raises: - GLib.Error- Returns: - the duplicate - Return type: - Gsf.Inputor- None- Duplicates self leaving the new one at the same offset. 
 - 
find_vba()¶
- Raises: - GLib.Error- Returns: - a - Gsf.Infile- Return type: - Gsf.InfileMSVBAor- None- A utility routine that attempts to find the VBA file withint a stream. 
 - 
get_modtime()¶
- Returns: - A - GLib.DateTimerepresenting when the input was last modified, or- Noneif not known.- Return type: - GLib.DateTime
 - 
name()¶
- Returns: - self’s name in utf8 form, or - Noneif it has no name.- Return type: - str- The name of the input stream. 
 - 
read(num_bytes)¶
- Parameters: - num_bytes ( - int) – number of bytes to read- Returns: - the data read. - Return type: - bytes- Read num_bytes. Does not change the current position if there is an error. Will only read if the entire amount can be read. 
 - 
seek(offset, whence)¶
- Parameters: - offset (int) – target offset
- whence (GLib.SeekType) – determines whether the offset is relative to the beginning or the end of the stream, or to the current location.
 - Returns: - Trueon error.- Return type: - Move the current location in the input stream. 
- offset (
 - 
seek_emulate(pos)¶
- Parameters: - pos ( - int) – absolute position to seek to- Returns: - Trueif the emulation failed.- Return type: - bool- Emulate forward seeks by reading. 
 - 
set_container(container)¶
- Parameters: - container ( - Gsf.Infileor- None) –- Returns: - Trueif the assignment was ok.- Return type: - bool
 - 
set_modtime(modtime)¶
- Parameters: - modtime ( - GLib.DateTimeor- None) – the new modification time.- Returns: - Trueif the assignment was ok.- Return type: - bool- protected. 
 - 
set_name(name)¶
- Parameters: - name ( - stror- None) – the new name of the stream- Returns: - Trueif the assignment was ok.- Return type: - bool- protected. 
 - 
set_name_from_filename(filename)¶
- Parameters: - filename ( - str) – the (fs-sys encoded) filename- Returns: - Trueif the assignment was ok.- Return type: - bool- protected. 
 - 
set_size(size)¶
- Parameters: - size ( - int) – the size of the stream- Returns: - Trueif the assignment was ok.- Return type: - bool
 - 
sibling(name)¶
- Parameters: - name ( - str) – name.- Raises: - GLib.Error- Returns: - A related - Gsf.Input- Return type: - Gsf.Input- UNIMPLEMENTED BY ANY BACKEND and it is probably unnecessary. gsf_input_get_container provides enough power to do what is necessary. - Attempts to open a ‘sibling’ of self. The caller is responsible for managing the resulting object. 
 - 
uncompress()¶
- Returns: - A stream equivalent to the source stream, but uncompressed if the source was compressed. - Return type: - Gsf.Input- This functions takes ownership of the incoming reference and yields a new one as its output. 
 - 
do_Dup() virtual¶
- Returns: - the duplicate - Return type: - Gsf.Inputor- None- Duplicates input leaving the new one at the same offset. 
 - 
do_OpenSibling(name) virtual¶
- Parameters: - name ( - str) – name.- Returns: - A related - Gsf.Input- Return type: - Gsf.Input- UNIMPLEMENTED BY ANY BACKEND and it is probably unnecessary. gsf_input_get_container provides enough power to do what is necessary. - Attempts to open a ‘sibling’ of input. The caller is responsible for managing the resulting object. 
 - 
do_Seek(offset, whence) virtual¶
- Parameters: - offset (int) – target offset
- whence (GLib.SeekType) – determines whether the offset is relative to the beginning or the end of the stream, or to the current location.
 - Returns: - Trueon error.- Return type: - Move the current location in the input stream. 
- offset (
 
- 
classmethod 
Property Details¶
- 
Gsf.Input.props.container¶
- Name: - container- Type: - Gsf.Infile- Default Value: - None- Flags: - READABLE- The container, optionally - None, in which this input lives.
- 
Gsf.Input.props.eof¶
- Name: - eof- Type: - bool- Default Value: - False- Flags: - READABLE- Trueif the end of the file has been reached.
- 
Gsf.Input.props.modtime¶
- Name: - modtime- Type: - GLib.DateTime- Default Value: - None- Flags: - READABLE- The time the input was last updated. This represents the timestamp from the originating file or GsfInfile member. It is not supported by all derived classes. 
- 
Gsf.Input.props.position¶
- Name: - position- Type: - int- Default Value: - 0- Flags: - READABLE- The current position in the input.