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


Golang LoadSaver.SaveSmallInt方法代碼示例

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


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

示例1: Save

// Save persists the pattern.
func (c Choice) Save(ls *persist.LoadSaver) {
	ls.SaveByte(choiceLoader)
	ls.SaveSmallInt(len(c))
	for _, pat := range c {
		pat.Save(ls)
	}
}
開發者ID:richardlehane,項目名稱:siegfried,代碼行數:8,代碼來源:patterns.go

示例2: save

func (fs *frameSet) save(ls *persist.LoadSaver) {
	ls.SaveSmallInt(len(fs.set))
	for _, f := range fs.set {
		f.Save(ls)
	}
	ls.SaveInts(fs.testTreeIndex)
}
開發者ID:richardlehane,項目名稱:siegfried,代碼行數:7,代碼來源:sets.go

示例3: Save

func Save(c core.Matcher, ls *persist.LoadSaver) {
	if c == nil {
		ls.SaveSmallInt(0)
		return
	}
	ls.SaveSmallInt(int(*c.(*Matcher)))
}
開發者ID:richardlehane,項目名稱:siegfried,代碼行數:7,代碼來源:textmatcher.go

示例4: Save

// Save persists the pattern.
func (s *RBMHSequence) Save(ls *persist.LoadSaver) {
	ls.SaveByte(rbmhLoader)
	ls.SaveBytes(s.Seq)
	for _, v := range s.Shift {
		ls.SaveSmallInt(v)
	}
}
開發者ID:richardlehane,項目名稱:siegfried,代碼行數:8,代碼來源:bmh.go

示例5: saveTestNodes

func saveTestNodes(ls *persist.LoadSaver, tns []*testNode) {
	ls.SaveSmallInt(len(tns))
	for _, n := range tns {
		n.Frame.Save(ls)
		ls.SaveInts(n.success)
		saveTestNodes(ls, n.tests)
	}
}
開發者ID:richardlehane,項目名稱:siegfried,代碼行數:8,代碼來源:testTrees.go

示例6: saveCTests

func saveCTests(ls *persist.LoadSaver, ct map[string]*cTest) {
	ls.SaveSmallInt(len(ct))
	for k, v := range ct {
		ls.SaveString(k)
		ls.SaveInts(v.satisfied)
		ls.SaveInts(v.unsatisfied)
		bytematcher.Save(v.bm, ls)
	}
}
開發者ID:richardlehane,項目名稱:siegfried,代碼行數:9,代碼來源:container.go

示例7: Save

func (i *Identifier) Save(ls *persist.LoadSaver) {
	ls.SaveByte(core.Pronom)
	ls.SaveSmallInt(len(i.infos))
	for k, v := range i.infos {
		ls.SaveString(k)
		ls.SaveString(v.name)
		ls.SaveString(v.version)
		ls.SaveString(v.mimeType)
	}
	i.Base.Save(ls)
}
開發者ID:richardlehane,項目名稱:siegfried,代碼行數:11,代碼來源:identifier.go

示例8: saveTests

func saveTests(ls *persist.LoadSaver, tts []*testTree) {
	ls.SaveSmallInt(len(tts))
	for _, tt := range tts {
		ls.SaveSmallInt(len(tt.complete))
		for _, kfid := range tt.complete {
			ls.SaveSmallInt(kfid[0])
			ls.SaveSmallInt(kfid[1])
		}
		ls.SaveSmallInt(len(tt.incomplete))
		for _, fu := range tt.incomplete {
			ls.SaveSmallInt(fu.kf[0])
			ls.SaveSmallInt(fu.kf[1])
			ls.SaveBool(fu.l)
			ls.SaveBool(fu.r)
		}
		ls.SaveInt(tt.maxLeftDistance)
		ls.SaveInt(tt.maxRightDistance)
		saveTestNodes(ls, tt.left)
		saveTestNodes(ls, tt.right)
	}
}
開發者ID:richardlehane,項目名稱:siegfried,代碼行數:21,代碼來源:testTrees.go

示例9: Save

func Save(c core.Matcher, ls *persist.LoadSaver) {
	if c == nil {
		ls.SaveSmallInt(0)
		return
	}
	m := c.(Matcher)
	ls.SaveSmallInt(len(m))
	for k, v := range m {
		ls.SaveString(k)
		ls.SaveSmallInt(len(v))
		for _, w := range v {
			ls.SaveSmallInt(w)
		}
	}
}
開發者ID:richardlehane,項目名稱:siegfried,代碼行數:15,代碼來源:mimematcher.go

示例10: saveKeyFrames

func saveKeyFrames(ls *persist.LoadSaver, kfs [][]keyFrame) {
	ls.SaveSmallInt(len(kfs))
	for _, v := range kfs {
		ls.SaveSmallInt(len(v))
		for _, kf := range v {
			ls.SaveByte(byte(kf.typ))
			ls.SaveInt(int(kf.seg.pMin))
			ls.SaveInt(int(kf.seg.pMax))
			ls.SaveSmallInt(kf.seg.lMin)
			ls.SaveSmallInt(kf.seg.lMax)
			ls.SaveInt(int(kf.key.pMin))
			ls.SaveInt(int(kf.key.pMax))
			ls.SaveSmallInt(kf.key.lMin)
			ls.SaveSmallInt(kf.key.lMax)
		}
	}

}
開發者ID:richardlehane,項目名稱:siegfried,代碼行數:18,代碼來源:keyframes.go

示例11: Save

func Save(c core.Matcher, ls *persist.LoadSaver) {
	if c == nil {
		ls.SaveSmallInt(0)
		return
	}
	m := c.(*Matcher)
	ls.SaveSmallInt(len(m.riffs))
	if len(m.riffs) == 0 {
		return
	}
	for k, v := range m.riffs {
		ls.SaveFourCC(k)
		ls.SaveSmallInt(len(v))
		for _, w := range v {
			ls.SaveSmallInt(w)
		}
	}
	m.priorities.Save(ls)
}
開發者ID:richardlehane,項目名稱:siegfried,代碼行數:19,代碼來源:riffmatcher.go

示例12: Save

func Save(c core.Matcher, ls *persist.LoadSaver) {
	if c == nil {
		ls.SaveBool(false)
		return
	}
	m := c.(*Matcher)
	ls.SaveBool(true)
	ls.SaveSmallInt(len(m.extensions))
	for k, v := range m.extensions {
		ls.SaveString(k)
		ls.SaveSmallInt(len(v))
		for _, w := range v {
			ls.SaveSmallInt(int(w))
		}
	}
	ls.SaveStrings(m.globs)
	ls.SaveSmallInt(len(m.globIdx))
	for _, v := range m.globIdx {
		ls.SaveInts(v)
	}
}
開發者ID:richardlehane,項目名稱:siegfried,代碼行數:21,代碼來源:namematcher.go

示例13: Save

func (s *Set) Save(ls *persist.LoadSaver) {
	ls.SaveInts(s.idx)
	ls.SaveSmallInt(len(s.lists))
	for _, v := range s.lists {
		ls.SaveSmallInt(len(v))
		for _, w := range v {
			ls.SaveInts(w)
		}
	}
	ls.SaveSmallInt(len(s.maxOffsets))
	for _, v := range s.maxOffsets {
		ls.SaveInt(v[0])
		ls.SaveInt(v[1])
	}
}
開發者ID:richardlehane,項目名稱:siegfried,代碼行數:15,代碼來源:priority.go


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