Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
codecs.IncrementalDecoder Class Reference

Inherits _object.

Inherited by _pyio.IncrementalNewlineDecoder, codecs.BufferedIncrementalDecoder, encodings.ascii.IncrementalDecoder, encodings.base64_codec.IncrementalDecoder, encodings.big5.IncrementalDecoder, encodings.big5hkscs.IncrementalDecoder, encodings.bz2_codec.IncrementalDecoder, encodings.charmap.IncrementalDecoder, encodings.cp037.IncrementalDecoder, encodings.cp1006.IncrementalDecoder, encodings.cp1026.IncrementalDecoder, encodings.cp1140.IncrementalDecoder, encodings.cp1250.IncrementalDecoder, encodings.cp1251.IncrementalDecoder, encodings.cp1252.IncrementalDecoder, encodings.cp1253.IncrementalDecoder, encodings.cp1254.IncrementalDecoder, encodings.cp1255.IncrementalDecoder, encodings.cp1256.IncrementalDecoder, encodings.cp1257.IncrementalDecoder, encodings.cp1258.IncrementalDecoder, encodings.cp424.IncrementalDecoder, encodings.cp437.IncrementalDecoder, encodings.cp500.IncrementalDecoder, encodings.cp720.IncrementalDecoder, encodings.cp737.IncrementalDecoder, encodings.cp775.IncrementalDecoder, encodings.cp850.IncrementalDecoder, encodings.cp852.IncrementalDecoder, encodings.cp855.IncrementalDecoder, encodings.cp856.IncrementalDecoder, encodings.cp857.IncrementalDecoder, encodings.cp858.IncrementalDecoder, encodings.cp860.IncrementalDecoder, encodings.cp861.IncrementalDecoder, encodings.cp862.IncrementalDecoder, encodings.cp863.IncrementalDecoder, encodings.cp864.IncrementalDecoder, encodings.cp865.IncrementalDecoder, encodings.cp866.IncrementalDecoder, encodings.cp869.IncrementalDecoder, encodings.cp874.IncrementalDecoder, encodings.cp875.IncrementalDecoder, encodings.cp932.IncrementalDecoder, encodings.cp949.IncrementalDecoder, encodings.cp950.IncrementalDecoder, encodings.euc_jis_2004.IncrementalDecoder, encodings.euc_jisx0213.IncrementalDecoder, encodings.euc_jp.IncrementalDecoder, encodings.euc_kr.IncrementalDecoder, encodings.gb18030.IncrementalDecoder, encodings.gb2312.IncrementalDecoder, encodings.gbk.IncrementalDecoder, encodings.hex_codec.IncrementalDecoder, encodings.hp_roman8.IncrementalDecoder, encodings.hz.IncrementalDecoder, encodings.iso2022_jp.IncrementalDecoder, encodings.iso2022_jp_1.IncrementalDecoder, encodings.iso2022_jp_2004.IncrementalDecoder, encodings.iso2022_jp_2.IncrementalDecoder, encodings.iso2022_jp_3.IncrementalDecoder, encodings.iso2022_jp_ext.IncrementalDecoder, encodings.iso2022_kr.IncrementalDecoder, encodings.iso8859_10.IncrementalDecoder, encodings.iso8859_11.IncrementalDecoder, encodings.iso8859_13.IncrementalDecoder, encodings.iso8859_14.IncrementalDecoder, encodings.iso8859_15.IncrementalDecoder, encodings.iso8859_16.IncrementalDecoder, encodings.iso8859_1.IncrementalDecoder, encodings.iso8859_2.IncrementalDecoder, encodings.iso8859_3.IncrementalDecoder, encodings.iso8859_4.IncrementalDecoder, encodings.iso8859_5.IncrementalDecoder, encodings.iso8859_6.IncrementalDecoder, encodings.iso8859_7.IncrementalDecoder, encodings.iso8859_8.IncrementalDecoder, encodings.iso8859_9.IncrementalDecoder, encodings.johab.IncrementalDecoder, encodings.koi8_r.IncrementalDecoder, encodings.koi8_u.IncrementalDecoder, encodings.latin_1.IncrementalDecoder, encodings.mac_arabic.IncrementalDecoder, encodings.mac_centeuro.IncrementalDecoder, encodings.mac_croatian.IncrementalDecoder, encodings.mac_cyrillic.IncrementalDecoder, encodings.mac_farsi.IncrementalDecoder, encodings.mac_greek.IncrementalDecoder, encodings.mac_iceland.IncrementalDecoder, encodings.mac_latin2.IncrementalDecoder, encodings.mac_roman.IncrementalDecoder, encodings.mac_romanian.IncrementalDecoder, encodings.mac_turkish.IncrementalDecoder, encodings.palmos.IncrementalDecoder, encodings.ptcp154.IncrementalDecoder, encodings.punycode.IncrementalDecoder, encodings.quopri_codec.IncrementalDecoder, encodings.raw_unicode_escape.IncrementalDecoder, encodings.rot_13.IncrementalDecoder, encodings.shift_jis.IncrementalDecoder, encodings.shift_jis_2004.IncrementalDecoder, encodings.shift_jisx0213.IncrementalDecoder, encodings.tis_620.IncrementalDecoder, encodings.undefined.IncrementalDecoder, encodings.unicode_escape.IncrementalDecoder, encodings.unicode_internal.IncrementalDecoder, encodings.uu_codec.IncrementalDecoder, encodings.zlib_codec.IncrementalDecoder, and test.test_io.StatefulIncrementalDecoder.

Collaboration diagram for codecs.IncrementalDecoder:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def decode
def reset
def getstate
def setstate

Public Attributes

 errors
_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Detailed Description

An IncrementalDecoder decodes an input in multiple steps. The input can
be passed piece by piece to the decode() method. The IncrementalDecoder
remembers the state of the decoding process between calls to decode().

Definition at line 232 of file codecs.py.


Constructor & Destructor Documentation

def codecs.IncrementalDecoder.__init__ (   self,
  errors = 'strict' 
)
Create a IncrementalDecoder instance.

The IncrementalDecoder may use different error handling schemes by
providing the errors keyword argument. See the module docstring
for a list of possible values.

Reimplemented in test.test_io.StatefulIncrementalDecoder, codecs.BufferedIncrementalDecoder, encodings.utf_16.IncrementalDecoder, encodings.utf_8_sig.IncrementalDecoder, encodings.utf_32.IncrementalDecoder, encodings.bz2_codec.IncrementalDecoder, and encodings.zlib_codec.IncrementalDecoder.

Definition at line 238 of file codecs.py.

00238 
00239     def __init__(self, errors='strict'):
00240         """
00241         Create a IncrementalDecoder instance.
00242 
00243         The IncrementalDecoder may use different error handling schemes by
00244         providing the errors keyword argument. See the module docstring
00245         for a list of possible values.
00246         """
00247         self.errors = errors

Here is the caller graph for this function:


Member Function Documentation

def codecs.IncrementalDecoder.decode (   self,
  input,
  final = False 
)
Decode input and returns the resulting object.

Reimplemented in test.test_io.StatefulIncrementalDecoder, _pyio.IncrementalNewlineDecoder, codecs.BufferedIncrementalDecoder, encodings.punycode.IncrementalDecoder, encodings.uu_codec.IncrementalDecoder, encodings.bz2_codec.IncrementalDecoder, encodings.zlib_codec.IncrementalDecoder, encodings.charmap.IncrementalDecoder, encodings.quopri_codec.IncrementalDecoder, encodings.base64_codec.IncrementalDecoder, encodings.hex_codec.IncrementalDecoder, encodings.undefined.IncrementalDecoder, encodings.hp_roman8.IncrementalDecoder, encodings.mac_latin2.IncrementalDecoder, encodings.ptcp154.IncrementalDecoder, encodings.rot_13.IncrementalDecoder, encodings.ascii.IncrementalDecoder, encodings.latin_1.IncrementalDecoder, encodings.raw_unicode_escape.IncrementalDecoder, encodings.unicode_escape.IncrementalDecoder, encodings.unicode_internal.IncrementalDecoder, encodings.cp720.IncrementalDecoder, encodings.palmos.IncrementalDecoder, encodings.cp037.IncrementalDecoder, encodings.cp1006.IncrementalDecoder, encodings.cp1026.IncrementalDecoder, encodings.cp1140.IncrementalDecoder, encodings.cp1250.IncrementalDecoder, encodings.cp1251.IncrementalDecoder, encodings.cp1252.IncrementalDecoder, encodings.cp1253.IncrementalDecoder, encodings.cp1254.IncrementalDecoder, encodings.cp1255.IncrementalDecoder, encodings.cp1256.IncrementalDecoder, encodings.cp1257.IncrementalDecoder, encodings.cp1258.IncrementalDecoder, encodings.cp424.IncrementalDecoder, encodings.cp437.IncrementalDecoder, encodings.cp500.IncrementalDecoder, encodings.cp737.IncrementalDecoder, encodings.cp775.IncrementalDecoder, encodings.cp850.IncrementalDecoder, encodings.cp852.IncrementalDecoder, encodings.cp855.IncrementalDecoder, encodings.cp856.IncrementalDecoder, encodings.cp857.IncrementalDecoder, encodings.cp858.IncrementalDecoder, encodings.cp860.IncrementalDecoder, encodings.cp861.IncrementalDecoder, encodings.cp862.IncrementalDecoder, encodings.cp863.IncrementalDecoder, encodings.cp864.IncrementalDecoder, encodings.cp865.IncrementalDecoder, encodings.cp866.IncrementalDecoder, encodings.cp869.IncrementalDecoder, encodings.cp874.IncrementalDecoder, encodings.cp875.IncrementalDecoder, encodings.iso8859_1.IncrementalDecoder, encodings.iso8859_10.IncrementalDecoder, encodings.iso8859_11.IncrementalDecoder, encodings.iso8859_13.IncrementalDecoder, encodings.iso8859_14.IncrementalDecoder, encodings.iso8859_15.IncrementalDecoder, encodings.iso8859_16.IncrementalDecoder, encodings.iso8859_2.IncrementalDecoder, encodings.iso8859_3.IncrementalDecoder, encodings.iso8859_4.IncrementalDecoder, encodings.iso8859_5.IncrementalDecoder, encodings.iso8859_6.IncrementalDecoder, encodings.iso8859_7.IncrementalDecoder, encodings.iso8859_8.IncrementalDecoder, encodings.iso8859_9.IncrementalDecoder, encodings.koi8_r.IncrementalDecoder, encodings.koi8_u.IncrementalDecoder, encodings.mac_arabic.IncrementalDecoder, encodings.mac_centeuro.IncrementalDecoder, encodings.mac_croatian.IncrementalDecoder, encodings.mac_cyrillic.IncrementalDecoder, encodings.mac_farsi.IncrementalDecoder, encodings.mac_greek.IncrementalDecoder, encodings.mac_iceland.IncrementalDecoder, encodings.mac_roman.IncrementalDecoder, encodings.mac_romanian.IncrementalDecoder, encodings.mac_turkish.IncrementalDecoder, and encodings.tis_620.IncrementalDecoder.

Definition at line 248 of file codecs.py.

00248 
00249     def decode(self, input, final=False):
00250         """
00251         Decode input and returns the resulting object.
00252         """
00253         raise NotImplementedError

Here is the caller graph for this function:

Return the current state of the decoder.

This must be a (buffered_input, additional_state_info) tuple.
buffered_input must be a bytes object containing bytes that
were passed to decode() that have not yet been converted.
additional_state_info must be a non-negative integer
representing the state of the decoder WITHOUT yet having
processed the contents of buffered_input.  In the initial state
and after reset(), getstate() must return (b"", 0).

Reimplemented in test.test_io.StatefulIncrementalDecoder, _pyio.IncrementalNewlineDecoder, codecs.BufferedIncrementalDecoder, encodings.utf_16.IncrementalDecoder, encodings.utf_8_sig.IncrementalDecoder, and encodings.utf_32.IncrementalDecoder.

Definition at line 259 of file codecs.py.

00259 
00260     def getstate(self):
00261         """
00262         Return the current state of the decoder.
00263 
00264         This must be a (buffered_input, additional_state_info) tuple.
00265         buffered_input must be a bytes object containing bytes that
00266         were passed to decode() that have not yet been converted.
00267         additional_state_info must be a non-negative integer
00268         representing the state of the decoder WITHOUT yet having
00269         processed the contents of buffered_input.  In the initial state
00270         and after reset(), getstate() must return (b"", 0).
00271         """
00272         return (b"", 0)

Reset the decoder to the initial state.

Reimplemented in test.test_io.StatefulIncrementalDecoder, _pyio.IncrementalNewlineDecoder, codecs.BufferedIncrementalDecoder, encodings.utf_16.IncrementalDecoder, encodings.utf_8_sig.IncrementalDecoder, encodings.utf_32.IncrementalDecoder, encodings.bz2_codec.IncrementalDecoder, and encodings.zlib_codec.IncrementalDecoder.

Definition at line 254 of file codecs.py.

00254 
00255     def reset(self):
00256         """
00257         Reset the decoder to the initial state.
00258         """

Here is the caller graph for this function:

def codecs.IncrementalDecoder.setstate (   self,
  state 
)
Set the current state of the decoder.

state must have been returned by getstate().  The effect of
setstate((b"", 0)) must be equivalent to reset().

Reimplemented in test.test_io.StatefulIncrementalDecoder, _pyio.IncrementalNewlineDecoder, codecs.BufferedIncrementalDecoder, encodings.utf_16.IncrementalDecoder, encodings.utf_32.IncrementalDecoder, and encodings.utf_8_sig.IncrementalDecoder.

Definition at line 273 of file codecs.py.

00273 
00274     def setstate(self, state):
00275         """
00276         Set the current state of the decoder.
00277 
00278         state must have been returned by getstate().  The effect of
00279         setstate((b"", 0)) must be equivalent to reset().
00280         """


Member Data Documentation

Create a IncrementalDecoder instance.

The IncrementalDecoder may use different error handling schemes by
providing the errors keyword argument. See the module docstring
for a list of possible values.

Reimplemented in encodings.bz2_codec.IncrementalDecoder, encodings.zlib_codec.IncrementalDecoder, encodings.base64_codec.IncrementalDecoder, and encodings.hex_codec.IncrementalDecoder.

Definition at line 246 of file codecs.py.

Definition at line 107 of file object.h.

struct _typeobject* _object::ob_type [inherited]

Definition at line 108 of file object.h.


The documentation for this class was generated from the following file: