// 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) } }
func (ss *seqSet) save(ls *persist.LoadSaver) { ls.SaveSmallInt(len(ss.set)) for _, v := range ss.set { ls.SaveBigInts(v.MaxOffsets) ls.SaveSmallInt(len(v.Choices)) for _, w := range v.Choices { ls.SaveSmallInt(len(w)) for _, x := range w { ls.SaveBytes(x) } } } ls.SaveInts(ss.testTreeIndex) }
// Save persists the pattern. func (s Sequence) Save(ls *persist.LoadSaver) { ls.SaveByte(sequenceLoader) ls.SaveBytes(s) }
func (r Range) Save(ls *persist.LoadSaver) { ls.SaveByte(rangeLoader) ls.SaveBytes(r.From) ls.SaveBytes(r.To) }
// Save persists the pattern. func (m Mask) Save(ls *persist.LoadSaver) { ls.SaveByte(maskLoader) m.pat.Save(ls) ls.SaveBytes(m.val) }
// Save persists the pattern. func (c IgnoreCase) Save(ls *persist.LoadSaver) { ls.SaveByte(ignoreCaseLoader) ls.SaveBytes(c) }
// Save persists the pattern. func (n Host32) Save(ls *persist.LoadSaver) { ls.SaveByte(host32Loader) buf := make([]byte, 4) binary.LittleEndian.PutUint32(buf, uint32(n)) ls.SaveBytes(buf) }
// Save persists the pattern. func (n Host16) Save(ls *persist.LoadSaver) { ls.SaveByte(host16Loader) buf := make([]byte, 2) binary.LittleEndian.PutUint16(buf, uint16(n)) ls.SaveBytes(buf) }
// Save persists the pattern. func (n Big32) Save(ls *persist.LoadSaver) { ls.SaveByte(big32Loader) buf := make([]byte, 4) binary.BigEndian.PutUint32(buf, uint32(n)) ls.SaveBytes(buf) }
// Save persists the pattern. func (n Big16) Save(ls *persist.LoadSaver) { ls.SaveByte(big16Loader) buf := make([]byte, 2) binary.BigEndian.PutUint16(buf, uint16(n)) ls.SaveBytes(buf) }