Mirage.Stream¶
- Implementations:
Methods¶
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
|
|
|
|
|
|
|
|
|
Properties¶
None
Signals¶
None
Fields¶
None
Class Details¶
- class Mirage.Stream¶
- Bases:
- Structure:
A stream object.
- get_filename()¶
- Returns:
pointer to a buffer containing the filename. The buffer belongs to the stream object and should not be modified.
- Return type:
Retrieves the name to file on which the stream is opened. If self is a filter stream in the filter stream chain, the filename is obtained from the stream at the bottom of the chain.
- get_g_input_stream()¶
- Returns:
a
Gio.InputStream
. The reference should be released usingGObject.Object.unref
() when no longer needed.- Return type:
Constructs and returns a compatibility object inheriting a
Gio.InputStream
. This is to allow regular GIO stream objects (for example, aGio.DataInputStream
) to be chained on top of our filter stream chain.
- is_writable()¶
-
Queries the stream (chain) for write support. For the stream to be writable, the stream object implementation itself must support write operations, and any stream objects below it in the stream chain must also be writable.
- move_file(new_filename)¶
- Parameters:
new_filename (
str
) – the new filename- Raises:
- Returns:
- Return type:
Attempts to move the file on top of which the stream (chain) is opened to new_filename. If supported, native move operations are used, otherwise a copy + delete fallback is used.
- read(buffer, count)¶
- Parameters:
- Raises:
- Returns:
number of bytes read, or -1 on error, or 0 on end of file.
- Return type:
Attempts to read count bytes from stream into the buffer starting at buffer. Will block during the operation.
- seek(offset, type)¶
- Parameters:
offset (
int
) – offset to seektype (
GLib.SeekType
) – seek type
- Raises:
- Returns:
- Return type:
Seeks in the stream by the given offset, modified by type.
- tell()¶
- Returns:
the offset from the beginning of the stream.
- Return type:
Retrieves the current position within the stream.
- write(buffer, count)¶
- Parameters:
- Raises:
- Returns:
number of bytes written, or -1 on error.
- Return type:
Attempts to write count bytes to stream from the buffer starting at buffer. Will block during the operation.
- do_get_filename() virtual¶
- Returns:
pointer to a buffer containing the filename. The buffer belongs to the stream object and should not be modified.
- Return type:
Retrieves the name to file on which the stream is opened. If self is a filter stream in the filter stream chain, the filename is obtained from the stream at the bottom of the chain.
- do_is_writable() virtual¶
-
Queries the stream (chain) for write support. For the stream to be writable, the stream object implementation itself must support write operations, and any stream objects below it in the stream chain must also be writable.
- do_move_file(new_filename) virtual¶
- Parameters:
new_filename (
str
) – the new filename- Returns:
- Return type:
Attempts to move the file on top of which the stream (chain) is opened to new_filename. If supported, native move operations are used, otherwise a copy + delete fallback is used.
- do_read(buffer, count) virtual¶
- Parameters:
- Returns:
number of bytes read, or -1 on error, or 0 on end of file.
- Return type:
Attempts to read count bytes from stream into the buffer starting at buffer. Will block during the operation.
- do_seek(offset, type) virtual¶
- Parameters:
offset (
int
) – offset to seektype (
GLib.SeekType
) – seek type
- Returns:
- Return type:
Seeks in the stream by the given offset, modified by type.
- do_tell() virtual¶
- Returns:
the offset from the beginning of the stream.
- Return type:
Retrieves the current position within the stream.
- do_write(buffer, count) virtual¶
- Parameters:
- Returns:
number of bytes written, or -1 on error.
- Return type:
Attempts to write count bytes to stream from the buffer starting at buffer. Will block during the operation.