コード例 #1
0
ファイル: identifier.go プロジェクト: ross-spencer/siegfried
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
}
コード例 #2
0
ファイル: bmh.go プロジェクト: ross-spencer/siegfried
func loadRBMH(ls *persist.LoadSaver) Pattern {
	rbmh := &RBMHSequence{}
	rbmh.Seq = Sequence(ls.LoadBytes())
	for i := range rbmh.Shift {
		rbmh.Shift[i] = ls.LoadSmallInt()
	}
	return rbmh
}
コード例 #3
0
ファイル: bmh.go プロジェクト: ross-spencer/siegfried
func loadBMH(ls *persist.LoadSaver) Pattern {
	bmh := &BMHSequence{}
	bmh.Seq = Sequence(ls.LoadBytes())
	for i := range bmh.Shift {
		bmh.Shift[i] = ls.LoadSmallInt()
	}
	return bmh
}
コード例 #4
0
ファイル: patterns.go プロジェクト: ross-spencer/siegfried
func loadList(ls *persist.LoadSaver) Pattern {
	le := ls.LoadSmallInt()
	list := make(List, le)
	for i := range list {
		list[i] = Load(ls)
	}
	return list
}
コード例 #5
0
ファイル: patterns.go プロジェクト: ross-spencer/siegfried
func loadChoice(ls *persist.LoadSaver) Pattern {
	l := ls.LoadSmallInt()
	choices := make(Choice, l)
	for i := range choices {
		choices[i] = Load(ls)
	}
	return choices
}
コード例 #6
0
ファイル: container.go プロジェクト: TidyHuang/siegfried
func loadCTests(ls *persist.LoadSaver) map[string]*cTest {
	ret := make(map[string]*cTest)
	l := ls.LoadSmallInt()
	for i := 0; i < l; i++ {
		ret[ls.LoadString()] = &cTest{
			satisfied:   ls.LoadInts(),
			unsatisfied: ls.LoadInts(),
			bm:          bytematcher.Load(ls),
		}
	}
	return ret
}
コード例 #7
0
ファイル: sets.go プロジェクト: ross-spencer/siegfried
func loadFrameSet(ls *persist.LoadSaver) *frameSet {
	ret := &frameSet{}
	le := ls.LoadSmallInt()
	if le == 0 {
		_ = ls.LoadInts()
		return ret
	}
	ret.set = make([]frames.Frame, le)
	for i := range ret.set {
		ret.set[i] = frames.Load(ls)
	}
	ret.testTreeIndex = ls.LoadInts()
	return ret
}
コード例 #8
0
ファイル: testTrees.go プロジェクト: seamang/siegfried
func loadTestNodes(ls *persist.LoadSaver) []*testNode {
	l := ls.LoadSmallInt()
	if l == 0 {
		return nil
	}
	ret := make([]*testNode, l)
	for i := range ret {
		ret[i] = &testNode{
			frames.Load(ls),
			ls.LoadInts(),
			loadTestNodes(ls),
		}
	}
	return ret
}
コード例 #9
0
ファイル: testTrees.go プロジェクト: seamang/siegfried
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
}
コード例 #10
0
ファイル: keyframes.go プロジェクト: glepore70/siegfried
func loadKeyFrames(ls *persist.LoadSaver) [][]keyFrame {
	kfs := make([][]keyFrame, ls.LoadSmallInt())
	for i := range kfs {
		kfs[i] = make([]keyFrame, ls.LoadSmallInt())
		for j := range kfs[i] {
			kfs[i][j].typ = frames.OffType(ls.LoadByte())
			kfs[i][j].seg.pMin = int64(ls.LoadInt())
			kfs[i][j].seg.pMax = int64(ls.LoadInt())
			kfs[i][j].seg.lMin = ls.LoadSmallInt()
			kfs[i][j].seg.lMax = ls.LoadSmallInt()
			kfs[i][j].key.pMin = int64(ls.LoadInt())
			kfs[i][j].key.pMax = int64(ls.LoadInt())
			kfs[i][j].key.lMin = ls.LoadSmallInt()
			kfs[i][j].key.lMax = ls.LoadSmallInt()
		}
	}
	return kfs
}
コード例 #11
0
func Load(ls *persist.LoadSaver) Matcher {
	le := ls.LoadSmallInt()
	if le == 0 {
		return nil
	}
	ret := make(Matcher)
	for i := 0; i < le; i++ {
		k := ls.LoadString()
		r := make([]result, ls.LoadSmallInt())
		for j := range r {
			r[j] = result(ls.LoadSmallInt())
		}
		ret[k] = r
	}
	return ret
}
コード例 #12
0
ファイル: priority.go プロジェクト: TidyHuang/siegfried
func Load(ls *persist.LoadSaver) *Set {
	set := &Set{}
	set.Idx = ls.LoadInts()
	if set.Idx == nil {
		_ = ls.LoadSmallInt() // discard the empty list too
		return set
	}
	set.Lists = make([]List, ls.LoadSmallInt())
	for i := range set.Lists {
		le := ls.LoadSmallInt()
		if le == 0 {
			continue
		}
		set.Lists[i] = make(List, le)
		for j := range set.Lists[i] {
			set.Lists[i][j] = ls.LoadInts()
		}
	}
	return set
}
コード例 #13
0
ファイル: sets.go プロジェクト: ross-spencer/siegfried
func loadSeqSet(ls *persist.LoadSaver) *seqSet {
	ret := &seqSet{}
	le := ls.LoadSmallInt()
	if le == 0 {
		_ = ls.LoadInts() // discard the empty testtreeindex list too
		return ret
	}
	ret.set = make([]wac.Seq, le)
	for i := range ret.set {
		ret.set[i].MaxOffsets = ls.LoadBigInts()
		ret.set[i].Choices = make([]wac.Choice, ls.LoadSmallInt())
		for j := range ret.set[i].Choices {
			ret.set[i].Choices[j] = make(wac.Choice, ls.LoadSmallInt())
			for k := range ret.set[i].Choices[j] {
				ret.set[i].Choices[j][k] = ls.LoadBytes()
			}
		}
	}
	ret.testTreeIndex = ls.LoadInts()
	return ret
}
コード例 #14
0
ファイル: textmatcher.go プロジェクト: TidyHuang/siegfried
func Load(ls *persist.LoadSaver) *Matcher {
	m := Matcher(ls.LoadSmallInt())
	return &m
}