本文整理汇总了Golang中github.com/richardlehane/siegfried/pkg/core/persist.LoadSaver类的典型用法代码示例。如果您正苦于以下问题:Golang LoadSaver类的具体用法?Golang LoadSaver怎么用?Golang LoadSaver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LoadSaver类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: 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:ross-spencer,项目名称:siegfried,代码行数:7,代码来源:sets.go
示例2: 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:ross-spencer,项目名称:siegfried,代码行数:8,代码来源:patterns.go
示例3: loadWildMin
func loadWildMin(ls *persist.LoadSaver) Frame {
return WildMin{
OffType(ls.LoadByte()),
ls.LoadInt(),
patterns.Load(ls),
}
}
开发者ID:ross-spencer,项目名称:siegfried,代码行数:7,代码来源:frames.go
示例4: loadFixed
func loadFixed(ls *persist.LoadSaver) Frame {
return Fixed{
OffType(ls.LoadByte()),
ls.LoadInt(),
patterns.Load(ls),
}
}
开发者ID:ross-spencer,项目名称:siegfried,代码行数:7,代码来源:frames.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:seamang,项目名称:siegfried,代码行数:8,代码来源:testTrees.go
示例6: 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
}
开发者ID:ross-spencer,项目名称:siegfried,代码行数:8,代码来源:bmh.go
示例7: 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
}
开发者ID:ross-spencer,项目名称:siegfried,代码行数:8,代码来源:bmh.go
示例8: loadList
func loadList(ls *persist.LoadSaver) Pattern {
le := ls.LoadSmallInt()
list := make(List, le)
for i := range list {
list[i] = Load(ls)
}
return list
}
开发者ID:ross-spencer,项目名称:siegfried,代码行数:8,代码来源:patterns.go
示例9: loadChoice
func loadChoice(ls *persist.LoadSaver) Pattern {
l := ls.LoadSmallInt()
choices := make(Choice, l)
for i := range choices {
choices[i] = Load(ls)
}
return choices
}
开发者ID:ross-spencer,项目名称:siegfried,代码行数:8,代码来源:patterns.go
示例10: Load
func Load(ls *persist.LoadSaver) Matcher {
ret := make(Matcher, ls.LoadTinyUInt())
for i := range ret {
ret[i] = loadCM(ls)
ret[i].ctype = ctypes[ret[i].conType]
ret[i].entryBufs = siegreader.New()
}
return ret
}
开发者ID:TidyHuang,项目名称:siegfried,代码行数:9,代码来源:container.go
示例11: Load
// Load a frame from a persist.LoadSaver
func Load(ls *persist.LoadSaver) Frame {
id := ls.LoadByte()
l := loaders[int(id)]
if l == nil {
if ls.Err == nil {
ls.Err = errors.New("bad frame loader")
}
return nil
}
return l(ls)
}
开发者ID:ross-spencer,项目名称:siegfried,代码行数:12,代码来源:frames.go
示例12: LoadIdentifier
// LoadIdentifier applies the appropriate IdentifierLoader to load an identifier.
func LoadIdentifier(ls *persist.LoadSaver) Identifier {
id := ls.LoadByte()
l := loaders[int(id)]
if l == nil {
if ls.Err == nil {
ls.Err = errors.New("bad identifier loader")
}
return nil
}
return l(ls)
}
开发者ID:ross-spencer,项目名称:siegfried,代码行数:12,代码来源:core.go
示例13: save
func (c *ContainerMatcher) save(ls *persist.LoadSaver) {
ls.SaveInts(c.startIndexes)
ls.SaveTinyUInt(int(c.conType))
saveCTests(ls, c.nameCTest)
ls.SaveInts(c.parts)
c.priorities.Save(ls)
ls.SaveString(c.extension)
}
开发者ID:TidyHuang,项目名称:siegfried,代码行数:8,代码来源:container.go
示例14: 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:seamang,项目名称:siegfried,代码行数:15,代码来源:testTrees.go
示例15: 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)
v.bm.Save(ls)
}
}
开发者ID:TidyHuang,项目名称:siegfried,代码行数:9,代码来源:container.go
示例16: Load
func Load(ls *persist.LoadSaver) *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),
maxBOF: ls.LoadInt(),
maxEOF: ls.LoadInt(),
priorities: priority.Load(ls),
mu: &sync.Mutex{},
}
}
开发者ID:glepore70,项目名称:siegfried,代码行数:17,代码来源:bytematcher.go
示例17: Save
func (m Matcher) Save(ls *persist.LoadSaver) {
ls.SaveSmallInt(len(m))
for k, v := range m {
ls.SaveString(k)
ls.SaveSmallInt(len(v))
for _, w := range v {
ls.SaveSmallInt(int(w))
}
}
}
开发者ID:ross-spencer,项目名称:siegfried,代码行数:10,代码来源:stringmatcher.go
示例18: 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)
}
}
}
开发者ID:TidyHuang,项目名称:siegfried,代码行数:10,代码来源:priority.go
示例19: 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:TidyHuang,项目名称:siegfried,代码行数:10,代码来源:container.go
示例20: Load
func Load(ls *persist.LoadSaver) *Set {
set := &Set{}
set.Idx = ls.LoadInts()
if set.Idx == nil {
_ = ls.LoadSmallInt() // discard the empty list too
return set
}
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()
}
}
return set
}
开发者ID:TidyHuang,项目名称:siegfried,代码行数:20,代码来源:priority.go
注:本文中的github.com/richardlehane/siegfried/pkg/core/persist.LoadSaver类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论