to_slash
pub fn to_slash(p &string) stringPurpose
Convert to slash.
Parameters
p&string- p (borrowed; caller keeps it; type &string)
Returns
string — result string
API
#path/filepathHost paths (volume, slash conversion), glob, and walk.
to_slashpub fn to_slash(p &string) stringConvert to slash.
p &stringstring — result string
from_slashpub fn from_slash(p &string) stringBuild from slash.
p &stringstring — result string
is_abspub fn is_abs(p &string) boolWhether it is abs.
p &stringbool — true or false
basepub fn base(p &string) stringBase name.
p &stringstring — result string
dirpub fn dir(p &string) stringDirectory.
p &stringstring — result string
extpub fn ext(p &string) stringExtension.
p &stringstring — result string
splitpub fn split(p &string) []stringSplit on the separator.
p &string[]string — slice result
cleanpub fn clean(p &string) stringclean folds.,.., and repeated separators ( filepath.Clean). Uses an int offset stack + string buffer (not []string[len-1] rebuild) that branch was not taken (frame/index poison).
p &stringstring — result string
list_separatorpub fn list_separator() intList separator.
none
int — a value of this type
split_listpub fn split_list(s &string) []stringSplit list.
s &string[]string — slice result
joinpub fn join(parts []string) stringJoin pieces with a separator.
parts []stringstring — result string
relpub fn rel(base_path &string, target &string) stringrel returns a relative path from base_path to target. Both are cleaned; if target cannot be made relative, returns Err. Throws on failure.
base_path &stringtarget &stringstring — result string
is_localpub fn is_local(p &string) boolWhether it is local.
p &stringbool — true or false
volume_namepub fn volume_name(p &string) stringVolume name.
p &stringstring — result string
matchespub fn matches(pattern &string, name &string) boolmatches; returns bool.
pattern &stringname &stringbool — true or false
abspub fn abs(p &string) stringAbsolute value.
p &stringstring — result string
globpub fn glob(pattern &string) []stringGlob. Throws on failure.
pattern &string[]string — slice result
walkpub fn walk(root string, visit fn(string, bool) int)Walk.
root stringvisit fn(string, bool) int