std::filesystem::path::lexically_normal,std::filesystem::path::lexically_relative,std::filesystem::path::lexically_proximate (3) - Linux Manuals
std::filesystem::path::lexically_normal,std::filesystem::path::lexically_relative,std::filesystem::path::lexically_proximate: std::filesystem::path::lexically_normal,std::filesystem::path::lexically_relative,std::filesystem::path::lexically_proximate
NAME
std::filesystem::path::lexically_normal,std::filesystem::path::lexically_relative,std::filesystem::path::lexically_proximate - std::filesystem::path::lexically_normal,std::filesystem::path::lexically_relative,std::filesystem::path::lexically_proximate
Synopsis
path lexically_normal() const; (1) (since C++17)
path lexically_relative(const path& base) const; (2) (since C++17)
path lexically_proximate(const path& base) const; (3) (since C++17)
1) Returns *this converted to normal_form in its generic format
2) Returns *this made relative to base.
3) If the value of lexically_relative(base) is not an empty path, return it. Otherwise return *this.
Parameters
(none)
Return value
1) The normal form of the path
2) The relative form of the path
3) The proximate form of the path
Exceptions
(none)
Notes
These conversions are purely lexical. They do not check that the paths exist, do not follow symlinks, and do not access the filesystem at all. For symlink-following counterparts of lexically_relative and lexically_proximate, see relative and proximate.
On Windows, the returned path has backslashes (the preferred separators),
Example
// Run this code
Defect reports
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR Applied to Behavior as published Correct behavior
LWG_3096 C++17 trailing "/" and "/." are handled incorrectly corrected
See also
relative composes a relative path
proximate (function)
(C++17)