Slash-separated path helpers, aligned with `path` package (not `path/filepath`). All operations allocate owned strings; slices copy.
Parameters
p&string
p (borrowed; caller keeps it; type &string)
Returns
bool — true or false
base
XuAPI
pubfn base(p &string) string
Purpose
Base name.
Parameters
p&string
p (borrowed; caller keeps it; type &string)
Returns
string — result string
dir
XuAPI
pubfn dir(p &string) string
Purpose
Directory.
Parameters
p&string
p (borrowed; caller keeps it; type &string)
Returns
string — result string
ext
XuAPI
pubfn ext(p &string) string
Purpose
Extension.
Parameters
p&string
p (borrowed; caller keeps it; type &string)
Returns
string — result string
split_list
XuAPI
pubfn split_list(s &string) []string
Purpose
Split list.
Parameters
s&string
source string (borrowed; caller keeps it; type &string)
Returns
[]string — slice result
join
XuAPI
pubfn join(parts []string) string
Purpose
Join pieces with a separator.
Parameters
parts[]string
parts ([]string)
Returns
string — result string
split
XuAPI
pubfn split(p &string) []string
Purpose
split returns [dir, file] like path.Split (dir keeps trailing /).
Parameters
p&string
p (borrowed; caller keeps it; type &string)
Returns
[]string — slice result
clean
XuAPI
pubfn clean(p &string) string
Purpose
clean folds.,.., and repeated separators ( path.Clean). Uses an int offset stack + string buffer (not []string[len-1] rebuild) that branch was not taken (frame/index poison).
Parameters
p&string
p (borrowed; caller keeps it; type &string)
Returns
string — result string
matches
XuAPI
pubfn matches(pattern &string, name &string) bool
Purpose
match reports whether name matches pattern ( path.Match (Xu: matches)).