Camel.StreamBuffer¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | Camel.Stream (10), GObject.Object (37), Gio.Seekable (5) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| class | new(stream, mode) | 
| discard_cache() | |
| gets(buf, cancellable) | |
| read_line(cancellable) | 
Virtual Methods¶
| Inherited: | Camel.Stream (5), GObject.Object (7), Gio.Seekable (5) | 
|---|
| do_init(stream, mode) | |
| do_init_vbuf(stream, mode, buf, size) | 
Properties¶
| Inherited: | Camel.Stream (1) | 
|---|
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
Class Details¶
- 
class Camel.StreamBuffer(**kwargs)¶
- Bases: - Camel.Stream- Abstract: - No - Structure: - Camel.StreamBufferClass- 
classmethod new(stream, mode)¶
- Parameters: - stream (Camel.Stream) – aCamel.Streamobject to buffer
- mode (Camel.StreamBufferMode) – Operational mode of buffered stream.
 - Returns: - a newly created buffered stream. - Return type: - Create a new buffered stream of another stream. A default buffer size (1024 bytes), automatically managed will be used for buffering. - The following values are available for mode: - Camel.StreamBufferMode.BUFFER, Buffer the input/output in blocks. #CAMEL_STREAM_BUFFER_NEWLINE, Buffer on newlines (for output).- Camel.StreamBufferMode.NONE, Perform no buffering.- Note that currently this is ignored and - Camel.StreamBufferMode.BUFFERis always used.- In addition, one of the following mode options should be or’d together with the buffering mode: - Camel.StreamBufferMode.WRITE, Buffer in write mode.- Camel.StreamBufferMode.READ, Buffer in read mode.- Buffering can only be done in one direction for any buffer instance. 
- stream (
 - 
discard_cache()¶
- Discards any cached data in the self. The next read reads from the stream. - New in version 3.38. 
 - 
gets(buf, cancellable)¶
- Parameters: - buf ([int]) – Memory to write the string to.
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Raises: - Returns: - the number of characters read, or 0 for end of file, and -1 on error. - Return type: - Read a line of characters up to the next newline character or max-1 characters. - If the newline character is encountered, then it will be included in the buffer buf. The buffer will be - Noneterminated.
- buf ([
 - 
read_line(cancellable)¶
- Parameters: - cancellable ( - Gio.Cancellableor- None) – optional- Gio.Cancellableobject, or- None- Raises: - GLib.Error- Returns: - the line read, which the caller must free when done with, or - Noneon eof. If an error occurs, error will be set.- Return type: - stror- None- This function reads a complete newline-terminated line from the stream and returns it in allocated memory. The trailing newline (and carriage return if any) are not included in the returned string. 
 - 
do_init(stream, mode) virtual¶
- Parameters: - stream (Camel.Stream) –
- mode (Camel.StreamBufferMode) –
 
- stream (
 - 
do_init_vbuf(stream, mode, buf, size) virtual¶
- Parameters: - stream (Camel.Stream) –
- mode (Camel.StreamBufferMode) –
- buf (str) –
- size (int) –
 
- stream (
 
- 
classmethod