本文整理匯總了Golang中github.com/richardlehane/siegfried/internal/persist.LoadSaver.LoadSmallInt方法的典型用法代碼示例。如果您正苦於以下問題:Golang LoadSaver.LoadSmallInt方法的具體用法?Golang LoadSaver.LoadSmallInt怎麽用?Golang LoadSaver.LoadSmallInt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/richardlehane/siegfried/internal/persist.LoadSaver
的用法示例。
在下文中一共展示了LoadSaver.LoadSmallInt方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: loadList
func loadList(ls *persist.LoadSaver) Pattern {
le := ls.LoadSmallInt()
list := make(List, le)
for i := range list {
list[i] = Load(ls)
}
return list
}
示例2: loadRBMH
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
}
示例3: loadChoice
func loadChoice(ls *persist.LoadSaver) Pattern {
l := ls.LoadSmallInt()
choices := make(Choice, l)
for i := range choices {
choices[i] = Load(ls)
}
return choices
}
示例4: loadBMH
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
}
示例5: 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
}
示例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.LoadString(),
ls.LoadString(),
}
}
i.Base = identifier.Load(ls)
return i
}
示例7: 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,
}
}
示例8: 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
}
示例9: 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
}
示例10: 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
}
示例11: 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
}
示例12: Load
func Load(ls *persist.LoadSaver) core.Matcher {
le := ls.LoadSmallInt()
if le == 0 {
return nil
}
ret := make(Matcher)
for i := 0; i < le; i++ {
k := [2]string{ls.LoadString(), ls.LoadString()}
r := make([]int, ls.LoadSmallInt())
for j := range r {
r[j] = ls.LoadSmallInt()
}
ret[k] = r
}
return ret
}
示例13: Load
func Load(ls *persist.LoadSaver) core.Matcher {
le := ls.LoadSmallInt()
if le == 0 {
return nil
}
riffs := make(map[riff.FourCC][]int)
for i := 0; i < le; i++ {
k := riff.FourCC(ls.LoadFourCC())
r := make([]int, ls.LoadSmallInt())
for j := range r {
r[j] = ls.LoadSmallInt()
}
riffs[k] = r
}
return &Matcher{
riffs: riffs,
priorities: priority.Load(ls),
}
}
示例14: 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
}
示例15: 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
}