MCPcopy
hub / github.com/qax-os/excelize / put

Method put

crypt.go:695–708  ·  view source on GitHub ↗

put provides a function to add an entry to compound file by given entry name and raw bytes.

(name string, content []byte)

Source from the content-addressed store, hash-verified

693// put provides a function to add an entry to compound file by given entry name
694// and raw bytes.
695func (c *cfb) put(name string, content []byte) {
696 path := c.paths[0]
697 if len(path) <= len(name) && name[:len(path)] == path {
698 path = name
699 } else {
700 if len(path) > 0 && string(path[len(path)-1]) != "/" {
701 path += "/"
702 }
703 path = strings.ReplaceAll(path+name, "//", "/")
704 }
705 file := sector{name: path, typeID: 2, content: content, size: len(content)}
706 c.sectors = append(c.sectors, file)
707 c.paths = append(c.paths, path)
708}
709
710// compare provides a function to compare object path, each set of sibling
711// objects in one level of the containment hierarchy (all child objects under

Callers 2

TestEncryptFunction · 0.95
EncryptFunction · 0.95

Calls

no outgoing calls

Tested by 1

TestEncryptFunction · 0.76