Exemplo n.º 1
0
func Load(ls *persist.LoadSaver) core.Identifier {
	i := &Identifier{}
	i.name = ls.LoadString()
	i.details = ls.LoadString()
	i.noPriority = ls.LoadBool()
	i.zipDefault = ls.LoadBool()
	i.infos = make(map[string]formatInfo)
	le := ls.LoadSmallInt()
	for j := 0; j < le; j++ {
		i.infos[ls.LoadString()] = formatInfo{
			ls.LoadString(),
			ls.LoadString(),
			ls.LoadString(),
		}
	}
	i.eStart = ls.LoadInt()
	i.ePuids = ls.LoadStrings()
	i.mStart = ls.LoadInt()
	i.mPuids = ls.LoadStrings()
	i.cStart = ls.LoadInt()
	i.cPuids = ls.LoadStrings()
	i.bStart = ls.LoadInt()
	i.bPuids = ls.LoadStrings()
	i.tStart = ls.LoadSmallInt()
	return i
}
Exemplo n.º 2
0
func Load(ls *persist.LoadSaver) *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),
		maxBOF:     ls.LoadInt(),
		maxEOF:     ls.LoadInt(),
		priorities: priority.Load(ls),
		mu:         &sync.Mutex{},
	}
}
Exemplo n.º 3
0
func loadTests(ls *persist.LoadSaver) []*testTree {
	l := ls.LoadSmallInt()
	ret := make([]*testTree, l)
	for i := range ret {
		ret[i] = &testTree{}
		ret[i].complete = make([]keyFrameID, ls.LoadSmallInt())
		for j := range ret[i].complete {
			ret[i].complete[j][0] = ls.LoadSmallInt()
			ret[i].complete[j][1] = ls.LoadSmallInt()
		}
		ret[i].incomplete = make([]followUp, ls.LoadSmallInt())
		for j := range ret[i].incomplete {
			ret[i].incomplete[j].kf[0] = ls.LoadSmallInt()
			ret[i].incomplete[j].kf[1] = ls.LoadSmallInt()
			ret[i].incomplete[j].l = ls.LoadBool()
			ret[i].incomplete[j].r = ls.LoadBool()
		}
		ret[i].maxLeftDistance = ls.LoadInt()
		ret[i].maxRightDistance = ls.LoadInt()
		ret[i].left = loadTestNodes(ls)
		ret[i].right = loadTestNodes(ls)
	}
	return ret
}