Back to index

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

List of all members.

Public Member Functions

def __init__
def encode
def reset
def getstate
def setstate

Public Attributes

 encoder
 errors
 buffer
_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Detailed Description

Definition at line 13 of file utf_32.py.


Constructor & Destructor Documentation

def encodings.utf_32.IncrementalEncoder.__init__ (   self,
  errors = 'strict' 
)
Creates an IncrementalEncoder instance.

The IncrementalEncoder 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.IncrementalEncoder.

Definition at line 14 of file utf_32.py.

00014 
00015     def __init__(self, errors='strict'):
00016         codecs.IncrementalEncoder.__init__(self, errors)
00017         self.encoder = None

Here is the call graph for this function:

Here is the caller graph for this function:


Member Function Documentation

def encodings.utf_32.IncrementalEncoder.encode (   self,
  input,
  final = False 
)
Encodes input and returns the resulting object.

Reimplemented from codecs.IncrementalEncoder.

Definition at line 18 of file utf_32.py.

00018 
00019     def encode(self, input, final=False):
00020         if self.encoder is None:
00021             result = codecs.utf_32_encode(input, self.errors)[0]
00022             if sys.byteorder == 'little':
00023                 self.encoder = codecs.utf_32_le_encode
00024             else:
00025                 self.encoder = codecs.utf_32_be_encode
00026             return result
00027         return self.encoder(input, self.errors)[0]

Here is the caller graph for this function:

Return the current state of the encoder.

Reimplemented from codecs.IncrementalEncoder.

Definition at line 32 of file utf_32.py.

00032 
00033     def getstate(self):
00034         # state info we return to the caller:
00035         # 0: stream is in natural order for this platform
00036         # 2: endianness hasn't been determined yet
00037         # (we're never writing in unnatural order)
00038         return (2 if self.encoder is None else 0)

Resets the encoder to the initial state.

Reimplemented from codecs.IncrementalEncoder.

Definition at line 28 of file utf_32.py.

00028 
00029     def reset(self):
00030         codecs.IncrementalEncoder.reset(self)
00031         self.encoder = None

Here is the call graph for this function:

Here is the caller graph for this function:

def encodings.utf_32.IncrementalEncoder.setstate (   self,
  state 
)
Set the current state of the encoder. state must have been
returned by getstate().

Reimplemented from codecs.IncrementalEncoder.

Definition at line 39 of file utf_32.py.

00039 
00040     def setstate(self, state):
00041         if state:
00042             self.encoder = None
00043         else:
00044             if sys.byteorder == 'little':
00045                 self.encoder = codecs.utf_32_le_encode
00046             else:
00047                 self.encoder = codecs.utf_32_be_encode


Member Data Documentation

Reimplemented in codecs.BufferedIncrementalEncoder.

Definition at line 173 of file codecs.py.

Definition at line 16 of file utf_32.py.

Creates an IncrementalEncoder instance.

The IncrementalEncoder 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.IncrementalEncoder, encodings.zlib_codec.IncrementalEncoder, encodings.base64_codec.IncrementalEncoder, and encodings.hex_codec.IncrementalEncoder.

Definition at line 172 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: