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

Method sharedStringsLoader

cell.go:464–484  ·  view source on GitHub ↗

sharedStringsLoader load shared string table from system temporary file to memory, and reset shared string table for reader.

()

Source from the content-addressed store, hash-verified

462// sharedStringsLoader load shared string table from system temporary file to
463// memory, and reset shared string table for reader.
464func (f *File) sharedStringsLoader() (err error) {
465 f.mu.Lock()
466 defer f.mu.Unlock()
467 if path, ok := f.tempFiles.Load(defaultXMLPathSharedStrings); ok {
468 f.Pkg.Store(defaultXMLPathSharedStrings, f.readBytes(defaultXMLPathSharedStrings))
469 f.tempFiles.Delete(defaultXMLPathSharedStrings)
470 if err = os.Remove(path.(string)); err != nil {
471 return
472 }
473 f.SharedStrings = nil
474 }
475 if f.sharedStringTemp != nil {
476 if err := f.sharedStringTemp.Close(); err != nil {
477 return err
478 }
479 f.tempFiles.Delete(defaultTempFileSST)
480 f.sharedStringItem, err = nil, os.Remove(f.sharedStringTemp.Name())
481 f.sharedStringTemp = nil
482 }
483 return
484}
485
486// setSharedString provides a function to add string to the share string table.
487func (f *File) setSharedString(val string) (int, error) {

Callers 3

setSharedStringMethod · 0.95
SetCellRichTextMethod · 0.95
writeToZipMethod · 0.95

Calls 2

readBytesMethod · 0.95
CloseMethod · 0.65

Tested by

no test coverage detected