Esempio n. 1
0
func loadCM(ls *persist.LoadSaver) *ContainerMatcher {
	return &ContainerMatcher{
		startIndexes: ls.LoadInts(),
		conType:      containerType(ls.LoadTinyUInt()),
		nameCTest:    loadCTests(ls),
		parts:        ls.LoadInts(),
		priorities:   priority.Load(ls),
		extension:    ls.LoadString(),
	}
}
Esempio n. 2
0
func Load(ls *persist.LoadSaver) core.Matcher {
	le := ls.LoadSmallInt()
	if le == 0 {
		return nil
	}
	riffs := make(map[riff.FourCC][]int)
	for i := 0; i < le; i++ {
		k := riff.FourCC(ls.LoadFourCC())
		r := make([]int, ls.LoadSmallInt())
		for j := range r {
			r[j] = ls.LoadSmallInt()
		}
		riffs[k] = r
	}
	return &Matcher{
		riffs:      riffs,
		priorities: priority.Load(ls),
	}
}
Esempio n. 3
0
// Load loads a Matcher.
func Load(ls *persist.LoadSaver) core.Matcher {
	if !ls.LoadBool() {
		return nil
	}
	return &Matcher{
		keyFrames:  loadKeyFrames(ls),
		tests:      loadTests(ls),
		bofFrames:  loadFrameSet(ls),
		eofFrames:  loadFrameSet(ls),
		bofSeq:     loadSeqSet(ls),
		eofSeq:     loadSeqSet(ls),
		knownBOF:   ls.LoadInt(),
		knownEOF:   ls.LoadInt(),
		maxBOF:     ls.LoadInt(),
		maxEOF:     ls.LoadInt(),
		priorities: priority.Load(ls),
		mu:         &sync.Mutex{},
	}
}