Path spelling of a platform: Windows or POSIX.
It tells how absolute paths are recognized and written: the separator
between segments, whether a path is absolute, and the root a path hangs
from. Windows paths carry drive letters and UNC shares and accept both
separators; POSIX paths root at /.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isPosix → bool
-
Whether this is the POSIX spelling.
no setter
- isWindows → bool
-
Whether this is the Windows spelling.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- separator → String
-
Separator between the segments of a path.
no setter
Methods
-
driveRoot(
String path) → String? -
The root
pathhangs from: a drive (C:\), a UNC share (\\server\share\), or the plain root (\or/). Returns null whenpathis relative. -
isAbsolute(
String path) → bool -
Whether
pathis absolute: on Windows a drive (C:\...), a UNC share (\\server\share\...) or a rooted path (\...or/...), on POSIX a leading/. -
join(
String base, String relative) → String -
Joins
relativeontobase, rewriting each/ofrelativeto this spelling's separator. -
normalize(
String path) → String -
pathnormalized to an absolute spelling: every separator becomes separator and every.and..segment is resolved against the root driveRoot gives. Excess..at the root are dropped; the spelling of the root itself is kept. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parentOf(
String path) → String? -
The directory holding
path, or null whenpathhas no directory component: a drive root, a bare root or a relative path without an ancestor. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- posix → const GitPathStyle
-
POSIX spelling:
/separator, a single root. - windows → const GitPathStyle
-
Windows spelling:
\separator, drives and UNC shares.