Beispiel #1
0
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
}
Beispiel #2
0
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
}
Beispiel #3
0
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
}
Beispiel #4
0
func loadSequence(ls *persist.LoadSaver) Pattern {
	return Sequence(ls.LoadBytes())
}
Beispiel #5
0
func loadRange(ls *persist.LoadSaver) patterns.Pattern {
	return Range{
		ls.LoadBytes(),
		ls.LoadBytes(),
	}
}
Beispiel #6
0
func loadMask(ls *persist.LoadSaver) patterns.Pattern {
	return Mask{
		pat: patterns.Load(ls),
		val: ls.LoadBytes(),
	}
}
Beispiel #7
0
func loadIgnoreCase(ls *persist.LoadSaver) patterns.Pattern {
	return IgnoreCase(ls.LoadBytes())
}
Beispiel #8
0
func loadHost32(ls *persist.LoadSaver) patterns.Pattern {
	return Host32(binary.LittleEndian.Uint32(ls.LoadBytes()))
}
Beispiel #9
0
func loadLittle16(ls *persist.LoadSaver) patterns.Pattern {
	return Little16(binary.LittleEndian.Uint16(ls.LoadBytes()))
}
Beispiel #10
0
func loadBig32(ls *persist.LoadSaver) patterns.Pattern {
	return Big32(binary.BigEndian.Uint32(ls.LoadBytes()))
}