Namespaces
Variants

operator<<,>> (std::experimental::filesystem::path)

From cppreference.net
template < class CharT, class Traits >

std:: basic_ostream < CharT,Traits > &

operator << ( std:: basic_ostream < CharT,Traits > & os, const path & p ) ;
(1) (filesystem TS)
template < class CharT, class Traits >

std:: basic_istream < CharT,Traits > &

operator >> ( std:: basic_istream < CharT,Traits > & is, path & p ) ;
(2) (filesystem TS)

경로 p 에 대한 스트림 입력 또는 출력을 수행합니다. std:: quoted 는 이후 스트림 입력 연산자로 읽을 때 공백으로 인한 잘림을 방지하기 위해 사용됩니다.

목차

매개변수

os - 출력을 수행할 스트림
is - 입력을 수행할 스트림
p - 삽입하거나 추출할 경로

반환값

1) os
2) is

예외

구현 정의 예외를 던질 수 있습니다.

가능한 구현

첫 번째 버전
template<class CharT, class Traits>
std::basic_ostream<CharT,Traits>&
    operator<<(std::basic_ostream<CharT,Traits>& os, const path& p)
{
    os << std::quoted(p.string<CharT,Traits>());
    return os;
}
두 번째 버전
template<class CharT, class Traits>
std::basic_istream<CharT,Traits>&
    operator>>(std::basic_istream<CharT,Traits>& is, path& p)
{
    std::basic_string<CharT, Traits> t;
    is >> std::quoted(t);
    p = t;
    return is;
}

예제