operator<<,>> (std::experimental::filesystem::path)
| Technical Specification | ||||
| Filesystem library (filesystem TS) | ||||
| Library fundamentals (library fundamentals TS) | ||||
| Library fundamentals 2 (library fundamentals TS v2) | ||||
| Library fundamentals 3 (library fundamentals TS v3) | ||||
| Extensions for parallelism (parallelism TS) | ||||
| Extensions for parallelism 2 (parallelism TS v2) | ||||
| Extensions for concurrency (concurrency TS) | ||||
| Extensions for concurrency 2 (concurrency TS v2) | ||||
| Concepts (concepts TS) | ||||
| Ranges (ranges TS) | ||||
| Reflection (reflection TS) | ||||
| Mathematical special functions (special functions TR) | ||||
| Experimental Non-TS | ||||
| Pattern Matching | ||||
| Linear Algebra | ||||
| std::execution | ||||
| Contracts | ||||
| 2D Graphics |
| Classes | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Functions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| File types | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Member functions | ||||
| Path decomposition | ||||
| Non-member functions | ||||
|
operator<<
operator>>
|
||||
|
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 | - | 要插入或提取的路径 |
返回值
异常
可能抛出实现定义的异常。
可能的实现
| 第一版本 |
|---|
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; } |
示例
|
本节内容不完整
原因:缺少示例 |