void clear() noexcept;
path& make_preferred();
Effects: Each directory-separator of the pathname in the generic format is converted to preferred-separator.
[ Example:
path p("foo/bar");
std::cout << p << '\n';
p.make_preferred();
std::cout << p << '\n';On an operating system where preferred-separator is a slash, the output is:
"foo/bar" "foo/bar"
On an operating system where preferred-separator is a backslash, the output is:
"foo/bar" "foo\bar"
— end example ]
path& remove_filename();
[ Example:
path("foo/bar").remove_filename(); // yields "foo/"
path("foo/").remove_filename(); // yields "foo/"
path("/foo").remove_filename(); // yields "/"
path("/").remove_filename(); // yields "/"
— end example ]
path& replace_filename(const path& replacement);
[ Example:
path("/foo").replace_filename("bar"); // yields "/bar" on POSIX
path("/").replace_filename("bar"); // yields "/bar" on POSIX
— end example ]
path& replace_extension(const path& replacement = path());
Effects:
Any existing extension()([fs.path.decompose]) is removed from the pathname in the generic format, then
If replacement is not empty and does not begin with a dot character, a dot character is appended to the pathname in the generic format, then
operator+=(replacement);.
void swap(path& rhs) noexcept;