Ported dna.Name, dna.Field, and started with dna.Struct

This commit is contained in:
Sybren A. Stüvel
2018-02-22 14:50:24 +01:00
parent 0532634d13
commit dcda85c3e6
4 changed files with 178 additions and 99 deletions
+5 -1
View File
@@ -4,7 +4,7 @@ import struct
import typing
class LittleEndianTypes:
class EndianIO:
UCHAR = struct.Struct(b'<b')
USHORT = struct.Struct(b'<H')
USHORT2 = struct.Struct(b'<HH') # two shorts in a row
@@ -61,6 +61,10 @@ class LittleEndianTypes:
raise ValueError('unsupported pointer size %d' % fileheader.pointer_size)
class LittleEndianTypes(EndianIO):
pass
class BigEndianTypes(LittleEndianTypes):
UCHAR = struct.Struct(b'>b')
USHORT = struct.Struct(b'>H')