
    h                         S SK JrJr  S SKrS SKJr  S SKJr  SSK7  SSK	J
r
  SSKJr  SS	KJr  SS
\S\4S jjr " S S\5      r " S S\5      rg)    )IterableTupleN)	BitStream)DXFClass   )*)crc8)
FileHeader)DwgSectionLoaderspecsdatac                 Z    U R                   [        ::  a  [        XU5      $ [        XU5      $ N)version	ACAD_2000DwgClassesSectionR2000DwgClassesSectionR2004)r   r   	crc_checks      R/var/www/html/env/lib/python3.13/site-packages/ezdxf/addons/dwg/classes_section.pyload_classes_sectionr      s(    }}	!%e9==%e9==    c                   D    \ rS rSrS\S\4S jrS\\\\	4      4S jr
Srg)r      r   returnc                     U R                   R                  [        :  a  [        U R                   R                  5      eU R                   R                  [
           u  p#XX#-    $ r   )r   r   r   DwgVersionErrorsections
CLASSES_ID)selfr   seekersection_sizes       r   load_data_section(DwgClassesSectionR2000.load_data_section   sN    ::	)!$**"4"455#zz22:>V233r   c           	   #     #    U R                   S [         nUS:w  a  [        S5      e[        n[        U R                   US  U R                  R
                  U R                  R                  S9nUR                  5       n[        S-   U-   nUS-
  nSU-   S-  nUR                  U:  a  UR                  5       nUR                  5       UR                  5       UR                  5       UR                  5       UR                  5       [        UR                  5       S:H  5      S.n	U[        R                  " U	S	94v   UR                  U:  a  M  U R                  (       a   U R                   XU[        -    nUS
:w  a  [        S5      eg 7f)Ns   ĸĩ_϶z0Sentinel for start of CLASSES section not found.)
dxfversionencoding         i  )flagsapp_namecpp_class_namenamewas_a_proxyis_an_entity)
dxfattribss   r^;G;V:?#0Iuz.Sentinel for end of CLASSES section not found.)r   SENTINEL_SIZEDwgCorruptedClassesSectionr   r   r   r&   read_unsigned_long	bit_indexread_bit_short	read_textread_bitintr   newr   structunpack_fromr	   CRCError)r   sentinelstart_indexbsclass_data_sizeend_sentinel_index	end_indexend_bit_index	class_numr0   checkcrcs               r   load_classes#DwgClassesSectionR2000.load_classes   sy    99^m,RS -B  $IIkl#zz))ZZ((

 //1*Q.@&*	_,2ll]*))+I**,LLN"$,,.!{{} #B$5$5$75$@ AJ X\\Z@@@ ll]* >>e 99m!C
 RS -@ Ss   EF	9F N)__name__
__module____qualname____firstlineno__Bytesr"   r   r   r8   r   rG   __static_attributes__rI   r   r   r   r      s/    4e 4 40huS(]';< 0r   r   c                   &    \ rS rSrS\S\4S jrSrg)r   P   r   r   c                     [        5       er   )NotImplementedError)r   r   s     r   	load_data DwgClassesSectionR2004.load_dataQ   s    !##r   rI   N)rJ   rK   rL   rM   rN   rT   rO   rI   r   r   r   r   P   s    $e $ $r   r   )F)typingr   r   r:   ezdxf.tools.binarydatar   ezdxf.entitiesr   constrF   r	   
fileheaderr
   header_sectionr   rN   r   r   r   rI   r   r   <module>r\      sM    #  , #   " ,>
 >% >7- 7t$3 $r   