Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
encodings.utf_16.IncrementalEncoder Class Reference
Inheritance diagram for encodings.utf_16.IncrementalEncoder:
Inheritance graph
[legend]
Collaboration diagram for encodings.utf_16.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 18 of file utf_16.py.


Constructor & Destructor Documentation

def encodings.utf_16.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 19 of file utf_16.py.

00019 
00020     def __init__(self, errors='strict'):
00021         codecs.IncrementalEncoder.__init__(self, errors)
00022         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_16.IncrementalEncoder.encode (   self,
  input,
  final = False 
)
Encodes input and returns the resulting object.

Reimplemented from codecs.IncrementalEncoder.

Definition at line 23 of file utf_16.py.

00023 
00024     def encode(self, input, final=False):
00025         if self.encoder is None:
00026             result = codecs.utf_16_encode(input, self.errors)[0]
00027             if sys.byteorder == 'little':
00028                 self.encoder = codecs.utf_16_le_encode
00029             else:
00030                 self.encoder = codecs.utf_16_be_encode
00031             return result
00032         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 37 of file utf_16.py.

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

Resets the encoder to the initial state.

Reimplemented from codecs.IncrementalEncoder.

Definition at line 33 of file utf_16.py.

00033 
00034     def reset(self):
00035         codecs.IncrementalEncoder.reset(self)
00036         self.encoder = None

Here is the call graph for this function:

Here is the caller graph for this function:

def encodings.utf_16.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 44 of file utf_16.py.

00044 
00045     def setstate(self, state):
00046         if state:
00047             self.encoder = None
00048         else:
00049             if sys.byteorder == 'little':
00050                 self.encoder = codecs.utf_16_le_encode
00051             else:
00052                 self.encoder = codecs.utf_16_be_encode


Member Data Documentation

Reimplemented in codecs.BufferedIncrementalEncoder.

Definition at line 173 of file codecs.py.

Definition at line 21 of file utf_16.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: