operators voor <filesystem>

Deze niet-lidoperators std::filesystem::path worden gedeclareerd in de C++17-header <filesystem> . De vergelijkingsoperatoren vergelijken twee padenelement per element in algemene indeling met behulp van path::compare, niet als onbewerkte tekenreeksen. Gebruik de equivalent functie om te bepalen of twee paden (bijvoorbeeld een relatief pad en een absoluut pad) verwijzen naar hetzelfde bestand of dezelfde map op schijf.

Opmerking

Op deze pagina worden de C++17-operators std::filesystem gedocumenten. Zie operators voor de historische vooraf gedefinieerde operators waarin MSVC is opgegeven<experimental/filesystem><experimental/filesystem>.

Zie Bestandssysteemnavigatie (C++) voor meer informatie.

Requirements

Rubriek:<filesystem>

Naamruimte:std::filesystem

operator==

bool operator==(const path& left, const path& right) noexcept;

De functie retourneert left.compare(right) == 0.

operator!=

bool operator!=(const path& left, const path& right) noexcept;

De functie retourneert !(left == right).

operator<

bool operator<(const path& left, const path& right) noexcept;

De functie retourneert left.compare(right) < 0.

operator<=

bool operator<=(const path& left, const path& right) noexcept;

De functie retourneert !(right < left).

operator>

bool operator>(const path& left, const path& right) noexcept;

De functie retourneert right < left.

operator>=

bool operator>=(const path& left, const path& right) noexcept;

De functie retourneert !(left < right).

Operator/

path operator/(const path& left, const path& right);

De functie retourneert path(left) /= right.

operator<<

template <class Elem, class Traits>
basic_ostream<Elem, Traits>& operator<<(basic_ostream<Elem, Traits>& os, const path& pval);

De functie voegt het pad in de stroom in als een tekenreeks tussen aanhalingstekens. Het geeft os << quoted(pval.string<Elem, Traits>()) terug.

operator>>

template <class Elem, class Traits>
basic_istream<Elem, Traits>& operator>>(basic_istream<Elem, Traits>& is, path& pval);

De functie extraheert een aanhalingstekenreeks uit de stream en wijst deze toe aan pval. Het voert het volgende uit:

basic_string<Elem, Traits> str;
is >> quoted(str);
pval = str;
return is;

Zie ook

headerbestanden
<filesystem>
Bestandssysteemnavigatie (C++)