PathCommon.opOpAssign

Concatenate the path other to this path.

  1. void opOpAssign(auto ref in InStringType str)
  2. void opOpAssign(auto ref in PathType other)
    mixin template PathCommon(TheStringType, alias theSeparator, alias theCaseSensitivity)
    void
    opOpAssign
    (
    string op : "~"
    )
    (
    auto ref in PathType other
    )
    if (
    isSomePath!PathType
    )
    if (
    isSomeString!TheStringType &&
    isSomeString!(typeof(theSeparator))
    )

Examples

1 assertEqual(PathType() ~ "hello", PathType("hello"));
2 assertEqual(PathType("") ~ "hello", PathType("hello"));
3 assertEqual(PathType(".") ~ "hello", PathType("hello"));
4 
5 assertEqual(WindowsPath("/") ~ "hello", WindowsPath(`hello`));
6 assertEqual(WindowsPath(`C:\`) ~ "hello" ~ "world", WindowsPath(`C:\hello\world`));
7 assertEqual(WindowsPath("hello") ~ "..", WindowsPath(`hello\..`));
8 assertEqual(WindowsPath("..") ~ "hello", WindowsPath(`..\hello`));
9 
10 assertEqual(PosixPath("/") ~ "hello", PosixPath("/hello"));
11 assertEqual(PosixPath("/") ~ "hello" ~ "world", PosixPath("/hello/world"));
12 assertEqual(PosixPath("hello") ~ "..", PosixPath("hello/.."));
13 assertEqual(PosixPath("..") ~ "hello", PosixPath("../hello"));

Meta