parent method
Implementation
WindowsPath? parent() {
final comps = components().toList();
if (comps.length == 1) {
switch (comps.first) {
case RootDir():
case Prefix():
return null;
case ParentDir():
case CurDir():
case Normal():
return WindowsPath("");
}
}
if (comps.length > 1) {
comps.removeLast();
} else {
return null;
}
if (comps.length == 1) {
final prefix = comps[0];
if (prefix case Prefix()) {
return null;
}
}
return _joinWindowsComponents(comps);
}