GMime.DataWrapper

g GMime.DataWrapper GMime.DataWrapper GObject.Object GObject.Object GObject.Object->GMime.DataWrapper

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

class

new_with_stream (stream, encoding)

get_encoding ()

get_stream ()

set_encoding (encoding)

set_stream (stream)

write_to_stream (stream)

Virtual Methods

Inherited:

GObject.Object (7)

do_write_to_stream (stream)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

encoding

GMime.ContentEncoding

r

the encoding of the content

parent_object

GObject.Object

r

parent GObject.Object

stream

GMime.Stream

r

content stream

Class Details

class GMime.DataWrapper(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

GMime.DataWrapperClass

A wrapper for a stream which may be encoded.

classmethod new()
Returns:

a new data wrapper object.

Return type:

GMime.DataWrapper

Creates a new GMime.DataWrapper object.

classmethod new_with_stream(stream, encoding)
Parameters:
Returns:

a data wrapper around stream. Since the wrapper owns its own reference on the stream, caller is responsible for unrefing its own copy.

Return type:

GMime.DataWrapper

Creates a new GMime.DataWrapper object around stream.

get_encoding()
Returns:

the encoding type of the internal stream.

Return type:

GMime.ContentEncoding

Gets the encoding type of the stream wrapped by self.

get_stream()
Returns:

a reference to the internal stream.

Return type:

GMime.Stream

Gets a reference to the stream wrapped by self.

set_encoding(encoding)
Parameters:

encoding (GMime.ContentEncoding) – encoding

Sets the encoding type of the internal stream.

set_stream(stream)
Parameters:

stream (GMime.Stream) – a GMime.Stream

Replaces the wrapper’s internal stream with stream. Don’t forget, if stream is not of the same encoding as the old stream, you’ll want to call GMime.DataWrapper.set_encoding() as well.

Note: caller is responsible for its own reference on stream.

write_to_stream(stream)
Parameters:

stream (GMime.Stream) – output stream

Returns:

the number of bytes written or %-1 on failure.

Return type:

int

Writes the raw (decoded) data to the output stream.

do_write_to_stream(stream) virtual
Parameters:

stream (GMime.Stream) – output stream

Returns:

the number of bytes written or %-1 on failure.

Return type:

int

Writes the raw (decoded) data to the output stream.