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


Golang LoadSaver.LoadInt方法代碼示例

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


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

示例1: loadWildMin

func loadWildMin(ls *persist.LoadSaver) Frame {
	return WildMin{
		OffType(ls.LoadByte()),
		ls.LoadInt(),
		patterns.Load(ls),
	}
}
開發者ID:richardlehane,項目名稱:siegfried,代碼行數:7,代碼來源:frames.go

示例2: loadFixed

func loadFixed(ls *persist.LoadSaver) Frame {
	return Fixed{
		OffType(ls.LoadByte()),
		ls.LoadInt(),
		patterns.Load(ls),
	}
}
開發者ID:richardlehane,項目名稱:siegfried,代碼行數:7,代碼來源:frames.go

示例3: loadKeyFrames

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

示例4: Load

// Load loads a Matcher.
func Load(ls *persist.LoadSaver) core.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),
		knownBOF:   ls.LoadInt(),
		knownEOF:   ls.LoadInt(),
		maxBOF:     ls.LoadInt(),
		maxEOF:     ls.LoadInt(),
		priorities: priority.Load(ls),
		mu:         &sync.Mutex{},
	}
}
開發者ID:richardlehane,項目名稱:siegfried,代碼行數:20,代碼來源:bytematcher.go

示例5: 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

示例6: loadTests

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

示例7: loadIndexes

func loadIndexes(ls *persist.LoadSaver) indexes {
	return indexes{
		ls.LoadInt(),
		ls.LoadStrings(),
	}
}
開發者ID:richardlehane,項目名稱:siegfried,代碼行數:6,代碼來源:base.go


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