This class provides a convenient way of working with paths. It supports the common path formats:
directory1/directory2/filename.extension
directory1\directory2\filename.extension
Static methods
staticdirectory(path:String):String
Available with clay native, tilemap plugin
Returns the directory of path
.
If the directory is null
, the empty String ""
is returned.
If path
is null
, the result is unspecified.
staticaddTrailingSlash(path:String):String
Adds a trailing slash to path
, if it does not have one already.
If the last slash in path
is a backslash, a backslash is appended to
path
.
If the last slash in path
is a slash, or if no slash is found, a slash
is appended to path
. In particular, this applies to the empty String
""
.
If path
is null
, the result is unspecified.
staticremoveTrailingSlashes(path:String):String
Available on clay native
Removes trailing slashes from path
.
If path
does not end with a /
or \
, path
is returned unchanged.
Otherwise the substring of path
excluding the trailing slashes or
backslashes is returned.
If path
is null
, the result is unspecified.
Constructor
Variables
dir:Null<String>
Available with clay native, tilemap plugin
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
.
file:String
Available with clay native, tilemap plugin
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 ""
.