pathify library

A byte-level, cross-platform path manipulation library.

Operates on raw bytes (Uint8List on Unix, Uint16List on Windows) rather than strings. Correctly handles all Windows path prefix types including verbatim (\\?\), UNC, and device namespace (\\.\) paths. Suitable for paths containing non-UTF-8 filenames.

Classes

CodeUnits
A platform-agnostic view over a sequence of path code units.
Component
A single component of a path.
ComponentCurDir
A reference to the current directory: ..
ComponentNormal
A normal path component such as a directory or file name.
ComponentParentDir
A reference to the parent directory: ...
ComponentPrefix
A Windows path prefix appearing as the first component of a path.
ComponentRootDir
The root directory component.
Components
A double-ended iterator over the components of a path.
DeviceNS
Device namespace prefix: \\.\ followed by a device name.
Disk
Disk prefix: a drive letter followed by :.
Iter
An iterator that yields each component's code units directly.
NarrowCodeUnits
A CodeUnits view backed by a Uint8List.
PathBuf
An owned, mutable path.
Pathify
Singleton that controls how pathify identifies the current platform.
Prefix
A Windows path prefix.
UNC
UNC prefix: \\ followed by a server name and a share name.
UnixPaths
Unix path separator constants.
Verbatim
Verbatim prefix consisting of \\?\ followed by a single component.
VerbatimDisk
Verbatim disk prefix: \\?\ followed by a drive letter and :.
VerbatimUNC
Verbatim UNC prefix: \\?\UNC\ followed by a server name and a share name.
WideCodeUnits
A CodeUnits view backed by a Uint16List.
WindowsPaths
Windows path separator and prefix constants.

Enums

PathifyPlatform
The set of platforms that pathify recognizes.

Functions

isSeparator(int codeUnit) bool
True when codeUnit is one of the platform's path separators.
mainSeparator() int
The platform's primary path separator as a code unit.
mainSeparatorStr() String
The platform's primary path separator as a single-character string.

Exceptions / Errors

NormalizeError