當前位置: 首頁>>代碼示例>>Golang>>正文


Golang LoadSaver.LoadInts方法代碼示例

本文整理匯總了Golang中github.com/richardlehane/siegfried/internal/persist.LoadSaver.LoadInts方法的典型用法代碼示例。如果您正苦於以下問題:Golang LoadSaver.LoadInts方法的具體用法?Golang LoadSaver.LoadInts怎麽用?Golang LoadSaver.LoadInts使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/richardlehane/siegfried/internal/persist.LoadSaver的用法示例。


在下文中一共展示了LoadSaver.LoadInts方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: Load

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,
	}
}
開發者ID:richardlehane,項目名稱:siegfried,代碼行數:28,代碼來源:namematcher.go

示例2: loadCM

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(),
	}
}
開發者ID:richardlehane,項目名稱:siegfried,代碼行數:10,代碼來源:container.go

示例3: loadCTests

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
}
開發者ID:richardlehane,項目名稱:siegfried,代碼行數:12,代碼來源:container.go

示例4: loadFrameSet

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
}
開發者ID:richardlehane,項目名稱:siegfried,代碼行數:14,代碼來源:sets.go

示例5: loadTestNodes

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
}
開發者ID:richardlehane,項目名稱:siegfried,代碼行數:15,代碼來源:testTrees.go

示例6: Load

func Load(ls *persist.LoadSaver) core.Identifier {
	i := &Identifier{}
	i.infos = make(map[string]formatInfo)
	le := ls.LoadSmallInt()
	for j := 0; j < le; j++ {
		i.infos[ls.LoadString()] = formatInfo{
			ls.LoadString(),
			ls.LoadBool(),
			ls.LoadInts(),
			ls.LoadInts(),
		}
	}
	i.Base = identifier.Load(ls)
	return i
}
開發者ID:richardlehane,項目名稱:siegfried,代碼行數:15,代碼來源:identifier.go

示例7: Load

func Load(ls *persist.LoadSaver) *Set {
	set := &Set{}
	set.idx = ls.LoadInts()
	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()
		}
	}
	set.maxOffsets = make([][2]int, ls.LoadSmallInt())
	for i := range set.maxOffsets {
		set.maxOffsets[i] = [2]int{ls.LoadInt(), ls.LoadInt()}
	}
	return set
}
開發者ID:richardlehane,項目名稱:siegfried,代碼行數:20,代碼來源:priority.go

示例8: loadSeqSet

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
}
開發者ID:richardlehane,項目名稱:siegfried,代碼行數:21,代碼來源:sets.go


注:本文中的github.com/richardlehane/siegfried/internal/persist.LoadSaver.LoadInts方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。