EgretDoc
Back to Home
Location:system/path

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
Signaturefunc join_path(a: String, b: String) -> String
func 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
Signaturefunc base(path: String) -> String
func 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
Signaturefunc dir(path: String) -> String
func dir(path: String) -> String {
    let n: Int = std.len(path);
    if n == 0 {
@briefGet the directory portion
@param
  • pathInput path
@returnDirectory portion
functionpath::ext
Signaturefunc ext(path: String) -> String
func 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
Signaturefunc clean(path: String) -> String
func 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).