Request for review - std.serialization (orange)

Jacob Carlborg doob at me.com
Tue Apr 2 00:29:27 PDT 2013


On 2013-03-24 22:03, Jacob Carlborg wrote:
> std.serialization (orange) is now ready to be reviewed.

I've been working on a binary archive with the following format:

FileFormat := CompoundArrayOffset Data CompoundArray
CompoundArrayOffset := AbsOffset # Offset of the compound array
AbsOffset := 4B # Absolute offset from the beginning of FileFormat
CompoundArray := Compound* # An array of Compound
CompoundOffset := 4B # Offset into CompoundArray
Data := Type*
Type := String | Array | Compound | AssociativeArray | Pointer | Enum | 
Primitive
Compound := ClassData | StructData
String := Length 4B* | 2B* | 1B*
Array := Length Type*
Class := CompoundOffset
Struct := CompoundOffset
ClassData := String Field*
StructData := Field*
Field := Type
Length := 4B
Primitive := Bool | Byte | Cdouble | Cfloat | Char | Creal | Dchar | 
Double | Float | Idouble | Ifloat | Int | Ireal | Long | Real | Short | 
Ubyte | Uint | Ulong | Ushort | Wchar
Bool := 1B
Byte := 1B
Cdouble := 8B 8B
Cfloat := 8B
Char := 1B
Creal := 8B 8B 8B 8B
Dchar := 4B
Double := 8B
Float := 4B
Idouble := 8B
Ifloat := 4B
Int := 4B
Ireal := 8B 8B
Long := 8B
Real := 8B 8B 8B 8B
Short := 2B
Ubyte := 1B
Uint := 4B
Ulong := 8B
Ushort := 2B
Wchar := 2B
1B := 1Byte
2B := 2Bytes
4B := 4Bytes
8B := 8Bytes

How does this look like?

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list