template< class CharT, class Traits > std::basic_ostream<CharT,Traits>& operator<<( std::basic_ostream<CharT,Traits>& os, const path& p ); | (1) | (since C++17) |
template< class CharT, class Traits > std::basic_istream<CharT,Traits>& operator>>( std::basic_istream<CharT,Traits>& is, path& p ); | (2) | (since C++17) |
Performs stream input or output on the path p
. std::quoted
is used so that spaces are not truncation when later read by stream input operator.
os | - | stream to perform output on |
is | - | stream to perform input on |
p | - | path to insert or extract |
os
is
(none).
First version |
---|
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; } |
Second version |
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; } |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://en.cppreference.com/w/cpp/filesystem/path/operator_ltltgtgt