MCPcopy Create free account
hub / github.com/cogentcore/core / Path

Method Path

tree/nodebase.go:234–239  ·  view source on GitHub ↗

Path returns the path to this node from the tree root, using [Node.Name]s separated by / delimeters. Any existing / characters in names are escaped to \\

()

Source from the content-addressed store, hash-verified

232// using [Node.Name]s separated by / delimeters. Any
233// existing / characters in names are escaped to \\
234func (n *NodeBase) Path() string {
235 if n.Parent != nil {
236 return n.Parent.AsTree().Path() + "/" + EscapePathName(n.Name)
237 }
238 return "/" + EscapePathName(n.Name)
239}
240
241// PathFrom returns the path to this node from the given parent node,
242// using [Node.Name]s separated by / delimeters. Any

Callers 11

TrackLightMethod · 0.95
StringMethod · 0.95
TestNodeAddChildFunction · 0.95
keyInputMethod · 0.45
TestNodeEmbedAddChildFunction · 0.45
TestNodeEmbedNewChildFunction · 0.45
TestNodePathFunction · 0.45
TestNodeEscapePathsFunction · 0.45
TestNodeWalkPathFunction · 0.45
TestDownFunction · 0.45
TestUpFunction · 0.45

Calls 2

EscapePathNameFunction · 0.85
AsTreeMethod · 0.65

Tested by 8

TestNodeAddChildFunction · 0.76
TestNodeEmbedAddChildFunction · 0.36
TestNodeEmbedNewChildFunction · 0.36
TestNodePathFunction · 0.36
TestNodeEscapePathsFunction · 0.36
TestNodeWalkPathFunction · 0.36
TestDownFunction · 0.36
TestUpFunction · 0.36