Path.drive
string drive() const @safeReturn the drive component of the path (Windows only).
Semantics (Windows):
- Drive-letter paths: "C:" for both absolute ("C:\\...") and drive-relative ("C:foo").
- UNC paths: "\\\\server\\share".
- Root-only paths like "\\foo" have an empty drive.
Returns
The drive string, or an empty string on non-Windows platforms or when the path has no drive.