operator<<,>>(std::experimental::filesystem::path)
來自 cppreference.com
< 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; } |
[編輯] 示例
| 本節不完整 原因:無示例 |