[fs.path.compare] (original) (raw)
31 Input/output library [input.output]
31.12 File systems [filesystems]
31.12.6 Class path [fs.class.path]
31.12.6.5 Members [fs.path.member]
31.12.6.5.8 Compare [fs.path.compare]
int compare(const path& p) const noexcept;
Returns:
- Let rootNameComparison be the result ofthis->root_name().native().compare(p.root_name().native()).
If rootNameComparison is not 0,rootNameComparison. - Otherwise, if!this->has_root_directory() and p.has_root_directory(), a value less than 0.
- Otherwise, ifthis->has_root_directory() and !p.has_root_directory(), a value greater than 0.
- Otherwise, ifnative() for the elements of this->relative_path() are lexicographically less thannative() for the elements of p.relative_path(), a value less than 0.
- Otherwise, ifnative() for the elements of this->relative_path() are lexicographically greater thannative() for the elements of p.relative_path(), a value greater than 0.
int compare(const string_type& s) const;int compare(basic_string_view<value_type> s) const;int compare(const value_type* s) const;
Effects: Equivalent to: return compare(path(s));