cpp/experimental/fs/path

Objects of type represent paths on a filesystem. Only syntactic aspects of paths are handled: the pathname may represent a non-existing path or even one that is not allowed to exist on the current file system or OS.

The path name has the following syntax:
 * : identifies the root on a filesystem with multiple roots (such as or . POSIX filesystems have single root.
 * : a directory separator that, if present, marks this path as absolute. If it is missing (and the first element other than the root name is a file name), then the path is relative and requires another path as the starting location to resolve to a file name.
 * 1) Zero or more of the following:
 * : sequence of characters that aren't directory separators or preferred directory separators (additional limitations may be imposed by the OS or file system). This name may identify a file, a hard link, a symbolic link, or a directory. Two special s are recognized:
 * : the file name consisting of a single dot character is a directory name that refers to the current directory
 * : the file name consisting of two dot characters is a directory name that refers to the parent directory.
 * s: the forward slash character or the alternative character provided as . If this character is repeated, it is treated as a single directory separator:  is the same as

The path can be traversed element-wise via iterators returned by the begin and end functions, which iterates over root name, root directory, and the subsequent file name elements (directory separators are skipped except the one that identifies the root directory). If the very last element in the path is a directory separator, the last iterator will dereference to a file name.

Calling any non-const member function of a invalidates all iterators referring to elements of that object.

If the OS uses a native syntax that is different from the portable generic syntax described above, all library functions accept path names in both formats.

Paths are implicitly convertible to and from stds, which makes it possible to use them with other file APIs, e.g. as an argument to std