File: format.go

package info (click to toggle)
fq 0.9.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 106,624 kB
  • sloc: xml: 2,835; makefile: 250; sh: 241; exp: 57; ansic: 21
file content (34 lines) | stat: -rw-r--r-- 652 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package decode

type Group struct {
	Name         string
	Formats      []*Format
	DefaultInArg any
}

type Dependency struct {
	Groups []*Group
	Out    *Group
}

type Format struct {
	Name               string
	ProbeOrder         int // probe order is from low to hi value then by name
	Description        string
	Groups             []*Group
	DecodeFn           func(d *D) any
	DefaultInArg       any
	RootArray          bool
	RootName           string
	Dependencies       []Dependency
	Functions          []string
	SkipDecodeFunction bool
}

func FormatFn(fn func(d *D) any) *Group {
	return &Group{
		Formats: []*Format{
			{DecodeFn: fn},
		},
	}
}