// 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) } }
// Save persists the pattern. func (l List) Save(ls *persist.LoadSaver) { ls.SaveByte(listLoader) ls.SaveSmallInt(len(l)) for _, pat := range l { pat.Save(ls) } }
// Save frame to a LoadSaver. func (w Window) Save(ls *persist.LoadSaver) { ls.SaveByte(windowLoader) ls.SaveByte(byte(w.OffType)) ls.SaveInt(w.MinOff) ls.SaveInt(w.MaxOff) w.Pattern.Save(ls) }
// 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) } }
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) } } }
func (i *Identifier) Save(ls *persist.LoadSaver) { ls.SaveByte(core.Pronom) ls.SaveString(i.name) ls.SaveString(i.details) ls.SaveBool(i.noPriority) 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) } ls.SaveInt(i.eStart) ls.SaveStrings(i.ePuids) ls.SaveInt(i.cStart) ls.SaveStrings(i.cPuids) ls.SaveInt(i.bStart) ls.SaveStrings(i.bPuids) ls.SaveSmallInt(i.tStart) }
// Save frame to a LoadSaver. func (w WildMin) Save(ls *persist.LoadSaver) { ls.SaveByte(wildMinLoader) ls.SaveByte(byte(w.OffType)) ls.SaveInt(w.MinOff) w.Pattern.Save(ls) }
// Save frame to a LoadSaver. func (w Wild) Save(ls *persist.LoadSaver) { ls.SaveByte(wildLoader) ls.SaveByte(byte(w.OffType)) w.Pattern.Save(ls) }
// Save frame to a LoadSaver. func (f Fixed) Save(ls *persist.LoadSaver) { ls.SaveByte(fixedLoader) ls.SaveByte(byte(f.OffType)) ls.SaveInt(f.Off) f.Pattern.Save(ls) }
func (am AnyMask) Save(ls *persist.LoadSaver) { ls.SaveByte(anyMaskLoader) ls.SaveByte(byte(am)) }
func (m Mask) Save(ls *persist.LoadSaver) { ls.SaveByte(maskLoader) ls.SaveByte(byte(m)) }
func (r Range) Save(ls *persist.LoadSaver) { ls.SaveByte(rangeLoader) ls.SaveBytes(r.From) ls.SaveBytes(r.To) }
// Save persists the pattern. func (n Not) Save(ls *persist.LoadSaver) { ls.SaveByte(notLoader) n.Pattern.Save(ls) }
// Save persists the pattern. func (s Sequence) Save(ls *persist.LoadSaver) { ls.SaveByte(sequenceLoader) ls.SaveBytes(s) }