haXe API Documentation
Back | Index
class haxe.io.Path
Available in flash8, neko, js, flash, php, cpp
This class provides a convenient way of working with paths. It supports the common path formats: directory1/directory2/filename.extension directory1\directory2\filename.excention
var backslash : Bool
True if the last directory separator is a backslash, false otherwise.
var dir : String

The directory.

This is the leading part of the path that is not part of the file name and the extension.

Does not end with a / or \ separator.

If the path has no directory, the value is null.

var ext : String

The file extension.

It is separated from the file name by a dot. This dot is not part of the extension.

If the path has no extension, the value is null.

var file : String

The file name.

This is the part of the part between the directory and the extension.

If there is no file name, e.g. for ".htaccess" or "/dir/", the value is the empty String "".

function new(path : String) : Void

Creates a new Path instance by parsing path.

Path information can be retrieved by accessing the dir, file and ext properties.

function toString() : String
static function addTrailingSlash(path : String) : String
static function directory(path : String) : String
static function extension(path : String) : String
static function withExtension(path : String, ext : String) : String
static function withoutDirectory(path : String) : String
static function withoutExtension(path : String) : String
Back | Index