package
0.0.0-20240329101916-eee87fb235a3
Repository: https://github.com/go-text/typesetting-utils.git
Documentation: pkg.go.dev
# Functions
ImportSource loads the source go file with go/packages, also returning the absolute path.
NewAnalyser load the package of `path` and analyze the defined structs, filling the fields [Source] and [Tables].
NewAnalyserFromPkg uses [pkg] to analyse the tables defined in [sourcePath].
ResolveOffsetRelative return the union flag of all the fields.
# Constants
The current slice is sliced at the current offset for the field.
The current slice is not resliced.
No description provided by the author
The length is deduced from an other field, parsed previously, or computed by a method or an expression.
No description provided by the author
The length is written at the start of the array, as an uint16.
The length is written at the start of the array, as an uint32.
No description provided by the author
The length must be provided by the context and is not found in the binary.
No description provided by the author
The offset is written as uint16.
The offset is written as uint32.
No description provided by the author
For raw data, that is slice of bytes, this special value indicates that the data must be copied until the offset (not the length) given by an other field, parsed previously, or computed by a method or an expression.
For raw data, that is slice of bytes, this special value indicates that the data must be copied until the end of the given slice.
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
Analyser provides information about types, shared by the parser and writer code generator.
No description provided by the author
Array is a fixed length array.
Basic is a fixed size type, directly convertible from and to uintXX.
DerivedFromBasic is stored as a an uintXX, but uses custom constructor to perform the convertion : <typeString>FromUintXX ; <typeString>ToUintXX.
Field is a struct field.
Offset is a fixed size integer pointing to an other type, which has never a fixed size.
Opaque represents a type with no binary structure.
No description provided by the author
Slice is a variable size array If Elem is [Offset], it represents a slice of (variable sized) elements written in binary as a slice of offsets.
Struct defines the the binary layout of a struct.
Union represents an union of several types, which are identified by constant flags.
UnionTagExplicit uses a field and defined constants.
UnionTagImplicit uses a common field and values defined by struct tags.
# Interfaces
Scope defines one step of parsing/writting, which may come from several fields.
Type is the common interface for struct field types supported by the package, describing the binary layout of a type.
UnionTagScheme is a union type for the two schemes supported : [UnionTagExplicit] or [UnionTagImplicit].
# Type aliases
ArrayCount defines how the number of elements in an array is defined.
BinarySize indicates how many bytes are needed to store a value.
OffsetRelative indicates if the offset is related to the current slice or the one of its parent type (or grand parent).
OffsetSize is the size (in bits) of the storage of an offset to a field type, or 0.
No description provided by the author
StaticSizedFields is a list of fields which all have a static size.
SubsliceStart indicates where the start of the subslice given to the field parsing function shall be computed.