GMime.Filter

g GMime.Filter GMime.Filter GObject.Object GObject.Object GObject.Object->GMime.Filter

Subclasses:

GMime.FilterBasic, GMime.FilterBest, GMime.FilterCharset, GMime.FilterChecksum, GMime.FilterDos2Unix, GMime.FilterEnriched, GMime.FilterFrom, GMime.FilterGZip, GMime.FilterHTML, GMime.FilterOpenPGP, GMime.FilterSmtpData, GMime.FilterStrip, GMime.FilterUnix2Dos, GMime.FilterWindows, GMime.FilterYenc

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

backup (data)

complete (inbuf, prespace)

copy ()

filter (inbuf, prespace)

reset ()

set_size (size, keep)

Virtual Methods

Inherited:

GObject.Object (7)

do_complete (inbuf, prespace)

do_copy ()

do_filter (inbuf, prespace)

do_reset ()

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

backbuf

str

r

backlen

int

r

backsize

int

r

outbuf

str

r

outpre

int

r

outptr

str

r

outreal

str

r

outsize

int

r

parent_object

GObject.Object

r

parent GObject.Object

priv

object

r

private state data

Class Details

class GMime.Filter(**kwargs)
Bases:

GObject.Object

Abstract:

Yes

Structure:

GMime.FilterClass

Base class for filters used by GMime.StreamFilter.

backup(data)
Parameters:

data (bytes) – data to backup

Sets number of bytes backed up on the input, new calls replace previous ones

complete(inbuf, prespace)
Parameters:
  • inbuf (bytes) – input buffer

  • prespace (int) – prespace buffer length

Returns:

outbuf:

pointer to output buffer

outprespace:

pointer to output prespace buffer length

Return type:

(outbuf: bytes, outprespace: int)

Completes the filtering.

copy()
Returns:

a duplicate of self.

Return type:

GMime.Filter

Copies self into a new GMime.Filter object.

filter(inbuf, prespace)
Parameters:
  • inbuf (bytes) – input buffer

  • prespace (int) – prespace buffer length

Returns:

outbuf:

pointer to output buffer

outprespace:

pointer to output prespace buffer length

Return type:

(outbuf: bytes, outprespace: int)

Filters the input data and writes it to out.

reset()

Resets the filter.

set_size(size, keep)
Parameters:
  • size (int) – requested size for the output buffer

  • keep (bool) – True if existing data in the output buffer should be kept

Ensure this much size is available for filter output (if required)

do_complete(inbuf, prespace) virtual
Parameters:
  • inbuf (bytes) – input buffer

  • prespace (int) – prespace buffer length

Returns:

outbuf:

pointer to output buffer

outprespace:

pointer to output prespace buffer length

Return type:

(outbuf: bytes, outprespace: int)

Completes the filtering.

do_copy() virtual
Returns:

a duplicate of filter.

Return type:

GMime.Filter

Copies filter into a new GMime.Filter object.

do_filter(inbuf, prespace) virtual
Parameters:
  • inbuf (bytes) – input buffer

  • prespace (int) – prespace buffer length

Returns:

outbuf:

pointer to output buffer

outprespace:

pointer to output prespace buffer length

Return type:

(outbuf: bytes, outprespace: int)

Filters the input data and writes it to out.

do_reset() virtual

Resets the filter.