ó
    ‰*£h  ã                   ó8   • S SK Jr  SSKJr  SrSr " S S5      rg)	é    ©ÚStructé   )ÚUnexpectedEndOfFileErrorÚ>Ú<c                   ó€   ^ • \ rS rSrSrSU 4S jjrS rSS jrSS jrSS jr	SS jr
SS	 jrS
 rS rS rS rSrU =r$ )ÚStreamReaderé	   zÉWraps a file-like object to provide access to structured data from a binary file.

Byte-order is configurable. `base_offset` is added to any base value provided to
calculate actual location for reads.
c                 óx   >• [         [        U ]  5         Xl        U[        :X  a  [        O[
        U l        X0l        g ©N)Úsuperr
   Ú__init__Ú_streamÚLITTLE_ENDIANÚ
BIG_ENDIANÚ_byte_orderÚ_base_offset)ÚselfÚstreamÚ
byte_orderÚbase_offsetÚ	__class__s       €ÚO/home/mande/repo/quber/.venv/lib/python3.13/site-packages/docx/image/helpers.pyr   ÚStreamReader.__init__   s,   ø€ ÜŒl˜DÑ*Ô,ØŒØ,6¼-Ó,G�=ÌZˆÔØ'Õó    c                 ó8   • U R                   R                  U5      $ )zAllow pass-through read() call.)r   Úread)r   Úcounts     r   r   ÚStreamReader.read   s   € à�|‰|× Ñ  Ó'Ð'r   c                 ó*   • SnU R                  X1U5      $ )z¶Return the int value of the byte at the file position defined by
self._base_offset + `base` + `offset`.

If `base` is None, the byte is read from the current position in the stream.
ÚB)Ú	_read_int©r   ÚbaseÚoffsetÚfmts       r   Ú	read_byteÚStreamReader.read_byte   s   € ð ˆØ�~‰~˜c¨Ó0Ð0r   c                 óT   • U R                   [        L a  SOSnU R                  X1U5      $ )a  Return the int value of the four bytes at the file position defined by
self._base_offset + `base` + `offset`.

If `base` is None, the long is read from the current position in the stream. The
endian setting of this instance is used to interpret the byte layout of the
long.
z<Lz>L©r   r   r#   r$   s       r   Ú	read_longÚStreamReader.read_long#   s)   € ð ×&Ñ&¬-Ò7‰d¸TˆØ�~‰~˜c¨Ó0Ð0r   c                 óT   • U R                   [        L a  SOSnU R                  X1U5      $ )z�Return the int value of the two bytes at the file position determined by
`base` and `offset`, similarly to ``read_long()`` above.s   <Hs   >Hr+   r$   s       r   Ú
read_shortÚStreamReader.read_short.   s)   € ð ×'Ñ'¬=Ò8‰e¸eˆØ�~‰~˜c¨Ó0Ð0r   c                 ób   • S nU" U5      nU R                  XRU5      nUR                  S5      nU$ )z{Return a string containing the `char_count` bytes at the file position
determined by self._base_offset + `base` + `offset`.c                 ó"   • SU -  n[        U5      $ )Nz%dsr   )Ú
char_countÚformat_s     r   Ú
str_structÚ)StreamReader.read_str.<locals>.str_struct8   s   € Ø˜jÑ(ˆGÜ˜'“?Ð"r   zUTF-8)Ú_unpack_itemÚdecode)r   r3   r%   r&   r5   ÚstructÚcharsÚunicode_strs           r   Úread_strÚStreamReader.read_str4   s9   € ò	#ñ ˜JÓ'ˆØ×!Ñ! &°Ó7ˆØ—l‘l 7Ó+ˆØÐr   c                 ó^   • U R                   U-   U-   nU R                  R                  U5        g r   )r   r   Úseek)r   r%   r&   Úlocations       r   r?   ÚStreamReader.seekA   s)   € Ø×$Ñ$ tÑ+¨fÑ4ˆØ�‰×Ñ˜(Õ#r   c                 ó6   • U R                   R                  5       $ )zAllow pass-through tell() call.)r   Útell)r   s    r   rC   ÚStreamReader.tellE   s   € à�|‰|× Ñ Ó"Ð"r   c                 óˆ   • U R                  X#5        U R                  R                  U5      n[        U5      U:  a  [        eU$ r   )r?   r   r   Úlenr   )r   Ú
byte_countr%   r&   Úbytes_s        r   Ú_read_bytesÚStreamReader._read_bytesI   s9   € Ø�	‰	�$ÔØ—‘×"Ñ" :Ó.ˆÜˆv‹;˜Ó#Ü*Ð*Øˆr   c                 ó<   • [        U5      nU R                  XBU5      $ r   )r   r7   )r   r'   r%   r&   r9   s        r   r#   ÚStreamReader._read_intP   s   € Ü˜“ˆØ× Ñ  ¨vÓ6Ð6r   c                 ób   • U R                  UR                  X#5      nUR                  U5      S   $ )Nr   )rI   ÚsizeÚunpack)r   r9   r%   r&   rH   s        r   r7   ÚStreamReader._unpack_itemT   s,   € Ø×!Ñ! &§+¡+¨tÓ<ˆØ�}‰}˜VÓ$ QÑ'Ð'r   )r   r   r   )r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r(   r,   r/   r<   r?   rC   rI   r#   r7   Ú__static_attributes__Ú__classcell__)r   s   @r   r
   r
   	   sD   ø† ñ÷(ò(ô1ô	1ô1ôô$ò#òò7÷(ð (r   r
   N)r9   r   Ú
exceptionsr   r   r   r
   © r   r   Ú<module>rZ      s!   ðÝ å 0à€
Ø€÷M(ò M(r   