Module
Module documentation.
modulepath
@briefPath manipulation
@detailsProvides lightweight join_path/base/dir/ext/clean helpers ('/' separator).
@see
- index.html
Classes
Classes and inheritance.
Functions
Free functions and class methods.
functionpath::join_path
Signature
func join_path(a: String, b: String) -> Stringfunc join_path(a: String, b: String) -> String {
if std.len(a) == 0 {
return b;@briefJoin two path segments
@param
- aFirst segment
- bSecond segment
@returnJoined path
functionpath::base
Signature
func base(path: String) -> Stringfunc base(path: String) -> String {
let n: Int = std.len(path);
if n == 0 {@briefGet the last path element
@detailsReturns the portion after the last '/'.
@param
- pathInput path
@returnBase name.
functionpath::dir
Signature
func dir(path: String) -> Stringfunc dir(path: String) -> String {
let n: Int = std.len(path);
if n == 0 {@briefGet the directory portion
@param
- pathInput path
@returnDirectory portion
functionpath::ext
Signature
func ext(path: String) -> Stringfunc ext(path: String) -> String {
let file_base: String = base(path);
let n: Int = std.len(file_base);@briefGet file extension
@param
- pathInput path
@returnExtension (including '.'), or ""
functionpath::clean
Signature
func clean(path: String) -> Stringfunc clean(path: String) -> String {
let n: Int = std.len(path);
if n == 0 {@briefClean a path
@param
- pathInput path
@returnCleaned path
@warningDoes not process '.' and '..' semantics.
Variables
Class fields (var).