Documentation ¶
Index ¶
- Constants
- type BasicNamedType
- type Field
- func (field Field) AccessPrefix() string
- func (field Field) CountType() string
- func (field Field) CountValue() string
- func (field Field) DefaultValue() string
- func (field Field) ElementStructID() string
- func (field Field) IsElement() bool
- func (field Field) IsFlags() bool
- func (field Field) ItemTypeName() string
- func (field Field) ManifestFieldType() (ManifestFieldType, error)
- func (field Field) PrettyString() (string, error)
- func (field Field) PrettyValue() string
- func (field Field) RehashValue() string
- func (field Field) RequiredValue() string
- func (field Field) Struct() *Struct
- func (field Field) TypeStdSize() int64
- type File
- type Func
- type Funcs
- type ManifestFieldType
- type Package
- type Struct
- func (_struct Struct) ElementStructID() string
- func (_struct Struct) ElementStructInfoField() *Field
- func (_struct Struct) ElementStructInfoVar0() string
- func (_struct Struct) ElementStructInfoVar1() string
- func (_struct Struct) ElementStructVersion() string
- func (_struct Struct) HasOnRehash() bool
- func (_struct Struct) IsElementsContainer() bool
- func (_struct Struct) Methods() Funcs
- func (_struct Struct) PrettyString() (string, error)
Constants ¶
const ( // ManifestFieldTypeUndefined indicates that the field is undefined ManifestFieldTypeUndefined = ManifestFieldType(iota) // ManifestFieldTypeElement indicates that the field is an element ManifestFieldTypeElement // ManifestFieldTypeElementList indicates that the field is a list of elements ManifestFieldTypeElementList // ManifestFieldTypeStructInfo indicates that the field is a StructInfo ManifestFieldTypeStructInfo // ManifestFieldTypeSubStruct indicates that the field is a underlaying struct ManifestFieldTypeSubStruct // ManifestFieldTypeEndValue indicates that the field is an EndValue ManifestFieldTypeEndValue // ManifestFieldTypeByteArrayDynamic indicates that the field is a´ dynamic byte array ManifestFieldTypeByteArrayDynamic // ManifestFieldTypeByteArrayStatic indicates that the field is a static byte array ManifestFieldTypeByteArrayStatic // ManifestFieldTypeList indicates that the field is a type list ManifestFieldTypeList )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicNamedType ¶
type BasicNamedType struct { gosrc.AstTypeSpec Parent *File }
BasicNamedType exports the structure BasiNamedType.
func (BasicNamedType) Methods ¶
func (t BasicNamedType) Methods() Funcs
Methods returns the functions of the BasicNamedType instance
func (BasicNamedType) PrettyString ¶
func (t BasicNamedType) PrettyString() (string, error)
PrettyString returns the instance of BasicNamedType as formatted string.
type Field ¶
Field is just a wrapper around gosrc.Field to provide necessary information for code generation.
func (Field) AccessPrefix ¶
AccessPrefix returns a prefix of a given field.
func (Field) CountType ¶
CountType returns the name of the type used to store the count of items of the slice. According to document #575623 it is usually uint16, but sometimes it is something else (for example uint8).
This method is used only for types ManifestFieldTypeByteArrayDynamic and ManifestFieldTypeList.
For example in table 5-11 (of document #575623) there are in particular fields `Count and `Digest`, where `Digest` is a list of HASH_STRUCTURE items and `Count` is the amount of these items. CountType defines the type of the field `Count` in this case (which is `uint16`).
func (Field) CountValue ¶
CountValue returns the value of Tag countValue
func (Field) DefaultValue ¶
DefaultValue returns the value of the Tag default
func (Field) ElementStructID ¶
ElementStructID returns the ElementStructID of a Field
func (Field) ItemTypeName ¶
ItemTypeName returns the type of the given field.
func (Field) ManifestFieldType ¶
func (field Field) ManifestFieldType() (ManifestFieldType, error)
ManifestFieldType returns the ManifestFieldType of the field instance
func (Field) PrettyString ¶
PrettyString returns a formatted string of the field structure instance
func (Field) PrettyValue ¶
PrettyValue returns the value of the Tag prettyValue
func (Field) RehashValue ¶
RehashValue returns the value of the tag rehashValue
func (Field) RequiredValue ¶
RequiredValue returns value of the Tag required
func (Field) TypeStdSize ¶
TypeStdSize returns the size (in bytes) of the field's value, if it has a static size.
For example if the field has type `uint32` or `[4]byte`, then the returned value will be `4`.
Basically this is something like `binary.Size(struct.Field)`.
type File ¶
type File struct { gosrc.File Parent *Package Structs map[string]*Struct BasicNamedTypes map[string]*BasicNamedType }
File struct has four fields. gosrc.File holds the associated file. Parent represents the package as element containing the file. Structs holds a map of all structures of a file matching to their name in string representation. BasicNamedTypes holds
type Func ¶
Func exports the Func struct
func (Func) PrettyStringForResult ¶
PrettyStringForResult returns a string corresponding with the documentation of the implemented function
func (Func) ReturnsFlagValue ¶
ReturnsFlagValue returns bool true if Function has a Flag value
func (Func) ReturnsTypeName ¶
ReturnsTypeName a string of the TypeName of the function
type ManifestFieldType ¶
type ManifestFieldType uint
ManifestFieldType represents the custom type
func (ManifestFieldType) String ¶
func (ft ManifestFieldType) String() string
type Package ¶
Package contains zwo fields. gosrc.Package and an slice of file pointers.
func (*Package) StructByName ¶
StructByName returns Struct with the given name.