View source

abstract thx.Path(Array<String>)

Available on all platforms

Path represents a pointer to a directory or file in a filesystem.

It supports both win32 and (U)nix style of path and tries to guess the correct type when parsing a string. If the guessing is not possible it assumes the Nix style by default.

Path can be conveted from/to styles using toWin32 and toNix.

Path are immutable objects and can combined using the / operator.


var p : Path = "/usr/local",
    dir = "haxe";
trace(p / dir); // prints "/usr/local/haxe"

Class Fields

inline var nixSeparator(default,null):String

inline var win32Separator(default,null):String

inline function create(root:String, path:Array<String>, sep:String):Path

function fromString(s:String):Path

Creates an instance of Path from a string.

function isValidNix(path:Path):Bool

function isValidWin32(path:Path):Bool

function normalizeNix(path:Path, replacement:String = "_"):Path

function normalizeWin32(path:Path, replacement:String = "_"):Path

inline function raw(parts:Array<String>):Path

function resolve(path:Array<String>, isAbsolute:Bool):Array<String>

Instance Fields

var path(get,null):Array<String>

var root(get,null):String

var sep(get,null):String

function asAbsolute(root:String = "C):Path

inline function asRelative():Path

function base(?end:String):String

function dir():String

function ext():String

function hierarchy():Array<Path>

inline function isAbsolute():Bool

inline function isNix():Bool

inline function isRelative():Bool

function isRoot():Bool

function isValid():Bool

inline function isWin32():Bool

function iterator():Iterator<Path>

function join(other:Path):Path

function map(handler:String -> String):Path

function noext():String

function normalize():Path

function pathTo(destination:Path):Path

function sibling(path:Path):Path

function toNix():Path

function toString():String

function toWin32(root:String = "C):Path

function up(n:Int = 1):Path

function withExt(newextension:String):Path