Esempio n. 1
0
func Load(ls *persist.LoadSaver) core.Matcher {
	if !ls.LoadBool() {
		return nil
	}
	le := ls.LoadSmallInt()
	var ext map[string][]int
	if le > 0 {
		ext = make(map[string][]int)
		for i := 0; i < le; i++ {
			k := ls.LoadString()
			r := make([]int, ls.LoadSmallInt())
			for j := range r {
				r[j] = ls.LoadSmallInt()
			}
			ext[k] = r
		}
	}
	globs := ls.LoadStrings()
	globIdx := make([][]int, ls.LoadSmallInt())
	for i := range globIdx {
		globIdx[i] = ls.LoadInts()
	}
	return &Matcher{
		extensions: ext,
		globs:      globs,
		globIdx:    globIdx,
	}
}
Esempio n. 2
0
func loadIndexes(ls *persist.LoadSaver) indexes {
	return indexes{
		ls.LoadInt(),
		ls.LoadStrings(),
	}
}