74 lines
5.5 KiB
HTML
74 lines
5.5 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh" dir="ltr" class="client-nojs" xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh">
|
|
<head><meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<title>std::filesystem::directory_entry::is_other</title>
|
|
<link rel="stylesheet" href="ext.css" />
|
|
<link rel="stylesheet" href="site_modules.css" />
|
|
</head>
|
|
<body class="mediawiki ltr sitedir-ltr ns-0 ns-subject page-cpp_filesystem_directory_entry_is_other skin-cppreference2 action-view cpp-navbar">
|
|
<div id="cpp-content-base">
|
|
<div id="content"><a id="top"></a>
|
|
<h1 id="firstHeading" class="firstHeading"><span style="font-size:0.7em; line-height:130%">std::filesystem::directory_entry::</span>is_other</h1>
|
|
<div id="bodyContent">
|
|
<div id="contentSub"><span class="subpages">< <a href="cpp.html">cpp</a>‎ | <a href="cpp-filesystem.html">filesystem</a>‎ | <a href="cpp-filesystem-directory_entry.html">directory entry</a></span></div>
|
|
<div id="mw-content-text" lang="zh" dir="ltr" class="mw-content-ltr" xml:lang="zh">
|
|
<table class="t-dcl-begin">
|
|
<tbody>
|
|
<tr class="t-dcl t-since-cxx17">
|
|
<td>
|
|
<div><span class="mw-geshi cpp source-cpp"><span class="kw4">bool</span> is_other<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span><br />
|
|
<span class="kw4">bool</span> is_other<span class="br0">(</span> <a href="cpp-error-error_code.html"><span class="kw877">std::<span class="me2">error_code</span></span></a><span class="sy3">&</span> ec <span class="br0">)</span> <span class="kw4">const</span> <span class="kw1">noexcept</span><span class="sy4">;</span></span></div>
|
|
</td>
|
|
<td class="t-dcl-nopad"></td>
|
|
<td><span class="t-mark-rev t-since-cxx17">(C++17 起)</span></td>
|
|
</tr>
|
|
<tr class="t-dcl-sep">
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>检查所指对象是否一个<i>其他</i>文件(非常规文件、目录或符号链接)。各等效于返回 <span class="t-lc">std::filesystem::is_other(status())</span> 或 <span class="t-lc">std::filesystem::is_other(status(ec))</span></p>
|
|
<h3><span class="mw-headline" id=".E5.8F.82.E6.95.B0">参数</span></h3>
|
|
<table class="t-par-begin">
|
|
<tr class="t-par">
|
|
<td>ec</td>
|
|
<td>-</td>
|
|
<td>不抛出重载中报告错误的输出参数</td>
|
|
</tr>
|
|
</table>
|
|
<h3><span class="mw-headline" id=".E8.BF.94.E5.9B.9E.E5.80.BC">返回值</span></h3>
|
|
<p>若所指代文件系统对象是<i>其他</i>文件则为 true ,否则为 false 。</p>
|
|
<h3><span class="mw-headline" id=".E5.BC.82.E5.B8.B8">异常</span></h3>
|
|
<p>不接受 <span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="cpp-error-error_code.html"><span class="kw877">std::<span class="me2">error_code</span></span></a><span class="sy3">&</span></span></span> 参数的重载在底层 OS API 错误时抛出 <a href="cpp-filesystem-filesystem_error.html"><tt>filesystem_error</tt></a> ,以第一 path 参数 <code>p</code> 和作为错误码参数的 OS 错误码构造。若 OS API 调用失败,则接受 <span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="cpp-error-error_code.html"><span class="kw877">std::<span class="me2">error_code</span></span></a><span class="sy3">&</span></span></span> 参数的重载设置该参数为 OS API 错误码,而若不出现错误则执行 <span class="t-c"><span class="mw-geshi cpp source-cpp">ec.<span class="me1">clear</span><span class="br0">(</span><span class="br0">)</span></span></span> 。若内存分配失败,则任何不标记为 <code>noexcept</code> 的重载可能抛出 <span class="t-lc"><a href="cpp-memory-new-bad_alloc.html">std::bad_alloc</a></span> 。</p>
|
|
<h3><span class="mw-headline" id=".E7.A4.BA.E4.BE.8B">示例</span></h3>
|
|
<table class="metadata plainlinks ambox mbox-small-left ambox-notice" style="">
|
|
<tr>
|
|
<td class="mbox-empty-cell"></td>
|
|
<td class="mbox-text" style="">本节未完成<br />
|
|
原因:暂无示例</td>
|
|
</tr>
|
|
</table>
|
|
<h3><span class="mw-headline" id=".E5.8F.82.E9.98.85">参阅</span></h3>
|
|
<table class="t-dsc-begin">
|
|
<tr class="t-dsc">
|
|
<td>
|
|
<div class="t-dsc-member-div">
|
|
<div><a href="cpp-filesystem-is_other.html"><span class="t-lines"><span>is_other</span></span></a></div>
|
|
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx17">(C++17)</span></span></span></div>
|
|
</div>
|
|
</td>
|
|
<td>检查参数是否表示一个<i>其他</i>文件<br />
|
|
<span class="t-mark">(函数)</span></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="visualClear"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|