Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
encodings.zlib_codec.IncrementalDecoder Class Reference
Inheritance diagram for encodings.zlib_codec.IncrementalDecoder:
Inheritance graph
[legend]
Collaboration diagram for encodings.zlib_codec.IncrementalDecoder:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def decode
def reset
def getstate
def setstate

Public Attributes

 errors
 decompressobj
_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Detailed Description

Definition at line 44 of file zlib_codec.py.


Constructor & Destructor Documentation

def encodings.zlib_codec.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 from codecs.IncrementalDecoder.

Definition at line 45 of file zlib_codec.py.

00045 
00046     def __init__(self, errors='strict'):
00047         assert errors == 'strict'
00048         self.errors = errors
00049         self.decompressobj = zlib.decompressobj()

Here is the caller graph for this function:


Member Function Documentation

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

Reimplemented from codecs.IncrementalDecoder.

Definition at line 50 of file zlib_codec.py.

00050 
00051     def decode(self, input, final=False):
00052         if final:
00053             c = self.decompressobj.decompress(input)
00054             return c + self.decompressobj.flush()
00055         else:
00056             return self.decompressobj.decompress(input)

Here is the caller graph for this function:

def codecs.IncrementalDecoder.getstate (   self) [inherited]
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 from codecs.IncrementalDecoder.

Definition at line 57 of file zlib_codec.py.

00057 
00058     def reset(self):
00059         self.decompressobj = zlib.decompressobj()

Here is the caller graph for this function:

def codecs.IncrementalDecoder.setstate (   self,
  state 
) [inherited]
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

Definition at line 48 of file zlib_codec.py.

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 from codecs.IncrementalDecoder.

Definition at line 47 of file zlib_codec.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: