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) }
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) } }
func (i *Identifier) Save(ls *persist.LoadSaver) { ls.SaveByte(core.MIMEInfo) ls.SaveSmallInt(len(i.infos)) for k, v := range i.infos { ls.SaveString(k) ls.SaveString(v.comment) ls.SaveBool(v.text) ls.SaveInts(v.globWeights) ls.SaveInts(v.magicWeights) } i.Base.Save(ls) }
func (b *Base) Save(ls *persist.LoadSaver) { ls.SaveString(b.name) ls.SaveString(b.details) ls.SaveTinyInt(int(b.multi)) ls.SaveBool(b.zipDefault) b.gids.save(ls) b.mids.save(ls) b.cids.save(ls) b.xids.save(ls) b.bids.save(ls) b.rids.save(ls) b.tids.save(ls) }
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) } } }
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) }
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) } }