MCPcopy Create free account
hub / github.com/pydio/cells / FromString

Method FromString

common/proto/tree/node.go:616–638  ·  view source on GitHub ↗
(str string)

Source from the content-addressed store, hash-verified

614}
615
616func (m *MPath) FromString(str string) *MPath {
617
618 var mpath [4]string
619
620 length := len(str)
621
622 for i := 0; i < 4; i++ {
623 start := i * 255
624 end := math.Min(length, (i+1)*255)
625 if length < start {
626 continue
627 }
628
629 mpath[i] = str[start:end]
630 }
631
632 m.MPath1 = mpath[0]
633 m.MPath2 = mpath[1]
634 m.MPath3 = mpath[2]
635 m.MPath4 = mpath[3]
636
637 return m
638}
639
640func (m *MPath) ToString() string {
641 var b strings.Builder

Callers 15

OpenRegistryMethod · 0.45
OpenStoreMethod · 0.45
OpenReaderMethod · 0.45
OpenProfilerMethod · 0.45
OpenCoreMethod · 0.45
OpenSyncMethod · 0.45
OpenServerMethod · 0.45
NewMPathFunction · 0.45
SiblingMethod · 0.45
ParentMethod · 0.45
ParentsMethod · 0.45
AppendMethod · 0.45

Calls 1

MinFunction · 0.92

Tested by 3

TestMPathLike_BuildFunction · 0.36
TestMPathEquals_ValidFunction · 0.36
TestMPathLike_ValidFunction · 0.36