Camel.StreamBuffer¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
Properties¶
- Inherited:
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class Camel.StreamBuffer(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new(stream, mode)¶
- Parameters:
stream (
Camel.Stream
) – aCamel.Stream
object to buffermode (
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.BUFFER
is 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.
- 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.Cancellable
orNone
) – optionalGio.Cancellable
object, 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
None
terminated.
- read_line(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Raises:
- Returns:
the line read, which the caller must free when done with, or
None
on eof. If an error occurs, error will be set.- Return type:
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
) –
- do_init_vbuf(stream, mode, buf, size) virtual¶
- Parameters:
stream (
Camel.Stream
) –mode (
Camel.StreamBufferMode
) –buf (
str
) –size (
int
) –