§
    £”j  ã                   ó@   — d dl mZ ddlmZ dZdZ G d„ d¦  «        ZdS )	é    ©ÚStructé   )ÚUnexpectedEndOfFileErrorú>ú<c                   ój   ‡ — e Zd ZdZdˆ fd„	Zd„ Zdd„Zdd„Zdd„Zdd„Z	dd	„Z
d
„ Zd„ Zd„ Zd„ Zˆ xZS )ÚStreamReaderzÕ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.
    r   c                 ó®   •— t          t          | ¦  «                             ¦   «          || _        |t          k    rt          nt
          | _        || _        d S ©N)Úsuperr
   Ú__init__Ú_streamÚLITTLE_ENDIANÚ
BIG_ENDIANÚ_byte_orderÚ_base_offset)ÚselfÚstreamÚ
byte_orderÚbase_offsetÚ	__class__s       €úa/var/www/finuniver-perm.ru/html/portfolio/venv/lib/python3.11/site-packages/docx/image/helpers.pyr   zStreamReader.__init__   sJ   ø€ Ý�l˜DÑ!Ô!×*Ò*Ñ,Ô,Ð,ØˆŒØ,6½-Ò,GÐ,G�=˜=ÍZˆÔØ'ˆÔÐÐó    c                 ó6   — | j                              |¦  «        S )zAllow pass-through read() call.)r   Úread)r   Úcounts     r   r   zStreamReader.read   s   € àŒ|× Ò  Ñ'Ô'Ð'r   c                 ó4   — d}|                       |||¦  «        S )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_bytezStreamReader.read_byte   s   € ð ˆØ�~Š~˜c 4¨Ñ0Ô0Ð0r   c                 óT   — | j         t          u rdnd}|                      |||¦  «        S )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_longzStreamReader.read_long#   s0   € ð Ô&­-Ð7Ð7ˆdˆd¸TˆØ�~Š~˜c 4¨Ñ0Ô0Ð0r   c                 óT   — | j         t          u rdnd}|                      |||¦  «        S )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_shortzStreamReader.read_short.   s0   € ð Ô'­=Ð8Ð8ˆeˆe¸eˆØ�~Š~˜c 4¨Ñ0Ô0Ð0r   c                 óz   — d„ } ||¦  «        }|                       |||¦  «        }|                     d¦  «        }|S )zƒReturn a string containing the `char_count` bytes at the file position
        determined by self._base_offset + `base` + `offset`.c                 ó*   — d| z  }t          |¦  «        S )Nz%dsr   )Ú
char_countÚformat_s     r   Ú
str_structz)StreamReader.read_str.<locals>.str_struct8   s   € Ø˜jÑ(ˆGÝ˜'‘?”?Ð"r   zUTF-8)Ú_unpack_itemÚdecode)r   r-   r"   r#   r/   ÚstructÚcharsÚunicode_strs           r   Úread_strzStreamReader.read_str4   sP   € ð	#ð 	#ð 	#ð �˜JÑ'Ô'ˆØ×!Ò! &¨$°Ñ7Ô7ˆØ—l’l 7Ñ+Ô+ˆØÐr   c                 óT   — | j         |z   |z   }| j                             |¦  «         d S r   )r   r   Úseek)r   r"   r#   Úlocations       r   r7   zStreamReader.seekA   s0   € ØÔ$ tÑ+¨fÑ4ˆØŒ×Ò˜(Ñ#Ô#Ð#Ð#Ð#r   c                 ó4   — | j                              ¦   «         S )zAllow pass-through tell() call.)r   Útell)r   s    r   r:   zStreamReader.tellE   s   € àŒ|× Ò Ñ"Ô"Ð"r   c                 óš   — |                       ||¦  «         | j                             |¦  «        }t          |¦  «        |k     rt          ‚|S r   )r7   r   r   Úlenr   )r   Ú
byte_countr"   r#   Úbytes_s        r   Ú_read_byteszStreamReader._read_bytesI   sG   € Ø�	Š	�$˜ÑÔÐØ”×"Ò" :Ñ.Ô.ˆÝˆv‰;Œ;˜Ò#Ð#Ý*Ð*Øˆr   c                 óN   — t          |¦  «        }|                      |||¦  «        S r   )r   r0   )r   r$   r"   r#   r2   s        r   r    zStreamReader._read_intP   s%   € Ý˜‘”ˆØ× Ò  ¨¨vÑ6Ô6Ð6r   c                 óp   — |                       |j        ||¦  «        }|                     |¦  «        d         S )Nr   )r?   ÚsizeÚunpack)r   r2   r"   r#   r>   s        r   r0   zStreamReader._unpack_itemT   s2   € Ø×!Ò! &¤+¨t°VÑ<Ô<ˆØ�}Š}˜VÑ$Ô$ QÔ'Ð'r   )r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r%   r(   r*   r5   r7   r:   r?   r    r0   Ú__classcell__)r   s   @r   r
   r
   	   sö   ø€ € € € € ðð ð(ð (ð (ð (ð (ð (ð(ð (ð (ð1ð 1ð 1ð 1ð	1ð 	1ð 	1ð 	1ð1ð 1ð 1ð 1ðð ð ð ð$ð $ð $ð $ð#ð #ð #ðð ð ð7ð 7ð 7ð(ð (ð (ð (ð (ð (ð (r   r
   N)r2   r   Ú
exceptionsr   r   r   r
   © r   r   ú<module>rK      so   ðØ Ð Ð Ð Ð Ð à 0Ð 0Ð 0Ð 0Ð 0Ð 0à€
Ø€ðM(ð M(ð M(ð M(ð M(ñ M(ô M(ð M(ð M(ð M(r   