std::experimental::filesystem::path (3) Linux Manual Page
std::experimental::filesystem::path – std::experimental::filesystem::path
Synopsis
Defined in header <experimental/filesystem>
class path; (filesystem TS)
Objects of type path 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:
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 dot.
Calling any non-const member function of a path 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 std::basic_strings, which makes it possible to use them with other file APIs, e.g. as an argument to std::ifstream::open
Member types
Type Definition
value_type character type used by the native encoding of the filesystem: char on POSIX, wchar_t on Windows
string_type std::basic_string<value_type>
const_iterator a constant LegacyBidirectionalIterator with a value_type of path
iterator an alias to const_iterator
Member constants
constexpr value_type preferred_separator alternative directory separator which may be used in addition to the portable /. On Windows, this is the backslash character \. On POSIX, this is the same forward slash / as the portable separator
[static]
Member functions
constructor (public member function)
destructor (public member function)
operator= (public member function)
assign (public member function)
Concatenation
append (public member function)
operator/=
concat (public member function)
operator+=
Modifiers
clear (public member function)
make_preferred (public member function)
remove_filename (public member function)
replace_filename (public member function)
replace_extension (public member function)
swap (public member function)
Format observers
c_str returns the native version of the path
native (public member function)
operator_string_type
string
wstring returns the path in native pathname format converted to a string
u8string (public member function)
u16string
u32string
generic_string
generic_wstring returns the path in generic pathname format converted to a string
generic_u8string (public member function)
generic_u16string
generic_u32string
Compare
compare (public member function)
Decomposition
root_name (public member function)
root_directory (public member function)
root_path (public member function)
relative_path (public member function)
parent_path (public member function)
filename (public member function)
stem (public member function)
extension (public member function)
Queries
empty (public member function)
has_root_path
has_root_name
has_root_directory checks if the corresponding path element is not empty
has_relative_path (public member function)
has_parent_path
has_filename
has_stem
has_extension
is_absolute (public member function)
is_relative
Iterators
begin (public member function)
end
Non-member functions
swap(std::experimental::filesystem::path) (function)
operator==
operator!= lexicographically compares two paths
operator< (function)
operator<=
operator>
operator>=
operator/ (function)
operator<< (function)
operator>>
u8path (function)
