operator<<,>>(std::experimental::filesystem::path)
来自 cppreference.cn
< cpp | experimental | fs | path
| template< class CharT, class Traits > std::basic_ostream<CharT,Traits>& |
(1) | (文件系统 TS) |
| template< class CharT, class Traits > std::basic_istream<CharT,Traits>& |
(2) | (文件系统 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; } |
[编辑] 示例
| 本节不完整 原因:无示例 |