Viewing File: /opt/alt/python35/lib64/python3.5/encodings/__pycache__/utf_32.cpython-35.pyc



Yf	@sdZddlZddlZejZdddZGdddejZGdd	d	ejZGd
ddej	Z	Gdd
d
ej
Z
ddZdS)z
Python 'utf-32' Codec
NstrictcCstj||dS)NT)codecs
utf_32_decode)inputerrorsr5/opt/alt/python35/lib64/python3.5/encodings/utf_32.pydecode
sr	c@sReZdZdddZdddZddZd	d
ZddZd
S)IncrementalEncoderrcCs tjj||d|_dS)N)rr
__init__encoder)selfrrrrrszIncrementalEncoder.__init__FcCsm|jdkrVtj||jd}tjdkrFtj|_ntj|_|S|j||jdS)Nrlittle)rr
utf_32_encodersys	byteorderutf_32_le_encodeutf_32_be_encode)r
rfinalresultrrrencodeszIncrementalEncoder.encodecCstjj|d|_dS)N)rr
resetr)r
rrrrszIncrementalEncoder.resetcCs|jdkrdSdS)Nr)r)r
rrrgetstate szIncrementalEncoder.getstatecCs@|rd|_n*tjdkr0tj|_ntj|_dS)Nr)rrrrrr)r
staterrrsetstate's
zIncrementalEncoder.setstateN)__name__
__module____qualname__rrrrrrrrrr

s

r
c@sOeZdZdddZddZddZdd	Zd
dZdS)
IncrementalDecoderrcCs tjj||d|_dS)N)rBufferedIncrementalDecoderrdecoder)r
rrrrr1szIncrementalDecoder.__init__cCs|jdkrtj||d|\}}}|dkrKtj|_n3|dkrftj|_n|dkr~td||fS|j||j|S)Nrz%UTF-32 stream does not start with BOM)r!rutf_32_ex_decodeutf_32_le_decodeutf_32_be_decodeUnicodeErrorr)r
rrroutputconsumedrrrr_buffer_decode5s!
z!IncrementalDecoder._buffer_decodecCstjj|d|_dS)N)rr rr!)r
rrrrBszIncrementalDecoder.resetcCs`tjj|d}|jdkr/|dfSttjdk|jtjkk}||fS)Nrrbig)rr rr!intrrr')r
rZaddstaterrrrFs
zIncrementalDecoder.getstatecCstjj|||d}|dkrPtjdkrAtjntj|_n<|dkrtjdkrttjntj|_n	d|_dS)Nr"rr,)rr rrrr'r&r!)r
rrrrrTs
zIncrementalDecoder.setstateN)rrrrr+rrrrrrrr0s

rc@s:eZdZdddZddZdddZdS)	StreamWriterrcCs#d|_tjj|||dS)N)rrr.r)r
streamrrrrrds	zStreamWriter.__init__cCstjj|d|_dS)N)rr.rr)r
rrrrhszStreamWriter.resetcCsc|jdkrOtj||}tjdkr?tj|_ntj|_|S|j||SdS)Nr)rrrrrrr)r
rrrrrrrlszStreamWriter.encodeN)rrrrrrrrrrr.csr.c@s+eZdZddZdddZdS)StreamReadercCs3tjj|y
|`Wntk
r.YnXdS)N)rr0rr	AttributeError)r
rrrrys


zStreamReader.resetrcCsytj||dd\}}}|dkr<tj|_n3|dkrWtj|_n|dkrotd||fS)NrFr"r#z%UTF-32 stream does not start with BOMr$)rr%r&r	r'r()r
rrobjectr*rrrrr	s!zStreamReader.decodeN)rrrrr	rrrrr0wsr0cCs4tjdddtdtdtdtdtdtS)	Nnamezutf-32rr	incrementalencoderincrementaldecoderstreamreaderstreamwriter)r	CodecInforr	r
rr0r.rrrrgetregentrys	r9)__doc__rrrrr	r
r rr.r0r9rrrr<module>s	#3
Back to Directory File Manager