posixData

posixData
(
PathType
)
(
auto ref in PathType p
)
if (
isSomePath!PathType
)

Return Value

Type: auto

The path data using forward slashes, regardless of the current platform.

Examples

1 assertEqual(WindowsPath().posixData, ".");
2 assertEqual(WindowsPath(``).posixData, ".");
3 assertEqual(WindowsPath(`.`).posixData, ".");
4 assertEqual(WindowsPath(`..`).posixData, "..");
5 assertEqual(WindowsPath(`/foo/bar`).posixData, `foo/bar`);
6 assertEqual(WindowsPath(`/foo/bar/`).posixData, `foo/bar`);
7 assertEqual(WindowsPath(`C:\foo/bar.exe`).posixData, `C:/foo/bar.exe`);
8 assertEqual(WindowsPath(`./foo\/../\/bar/.//\/baz.exe`).posixData, `foo/../bar/baz.exe`);
9 
10 assertEqual(PosixPath().posixData, `.`);
11 assertEqual(PosixPath(``).posixData, `.`);
12 assertEqual(PosixPath(`.`).posixData, `.`);
13 assertEqual(PosixPath(`..`).posixData, `..`);
14 assertEqual(PosixPath(`/foo/bar`).posixData, `/foo/bar`);
15 assertEqual(PosixPath(`/foo/bar/`).posixData, `/foo/bar`);
16 assertEqual(PosixPath(`.//foo\ bar/.//./baz.txt`).posixData, `foo\ bar/baz.txt`);

Meta