115 lines
7.5 KiB
HTML
115 lines
7.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::path::has_root_path, std::filesystem::path::has_root_name, std::filesystem::path::has_root_directory, std::filesystem::path::has_relative_path, std::filesystem::path::has_parent_path, std::filesystem::path::has_filename, std::filesystem::path::has_stem, std::filesystem::path::has_extension</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_path_has_path 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::path::</span>has_root_path, <span style="font-size:0.7em; line-height:130%">std::filesystem::path::</span>has_root_name, <span style="font-size:0.7em; line-height:130%">std::filesystem::path::</span>has_root_directory, <span style="font-size:0.7em; line-height:130%">std::filesystem::path::</span>has_relative_path, <span style="font-size:0.7em; line-height:130%">std::filesystem::path::</span>has_parent_path, <span style="font-size:0.7em; line-height:130%">std::filesystem::path::</span>has_filename, <span style="font-size:0.7em; line-height:130%">std::filesystem::path::</span>has_stem, <span style="font-size:0.7em; line-height:130%">std::filesystem::path::</span>has_extension</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-path.html">path</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> has_root_path<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span></span></div>
|
|
</td>
|
|
<td>(1)</td>
|
|
<td><span class="t-mark-rev t-since-cxx17">(C++17 起)</span></td>
|
|
</tr>
|
|
<tr class="t-dcl t-since-cxx17">
|
|
<td>
|
|
<div><span class="mw-geshi cpp source-cpp"><span class="kw4">bool</span> has_root_name<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span></span></div>
|
|
</td>
|
|
<td>(2)</td>
|
|
<td><span class="t-mark-rev t-since-cxx17">(C++17 起)</span></td>
|
|
</tr>
|
|
<tr class="t-dcl t-since-cxx17">
|
|
<td>
|
|
<div><span class="mw-geshi cpp source-cpp"><span class="kw4">bool</span> has_root_directory<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span></span></div>
|
|
</td>
|
|
<td>(3)</td>
|
|
<td><span class="t-mark-rev t-since-cxx17">(C++17 起)</span></td>
|
|
</tr>
|
|
<tr class="t-dcl t-since-cxx17">
|
|
<td>
|
|
<div><span class="mw-geshi cpp source-cpp"><span class="kw4">bool</span> has_relative_path<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span></span></div>
|
|
</td>
|
|
<td>(4)</td>
|
|
<td><span class="t-mark-rev t-since-cxx17">(C++17 起)</span></td>
|
|
</tr>
|
|
<tr class="t-dcl t-since-cxx17">
|
|
<td>
|
|
<div><span class="mw-geshi cpp source-cpp"><span class="kw4">bool</span> has_parent_path<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span></span></div>
|
|
</td>
|
|
<td>(5)</td>
|
|
<td><span class="t-mark-rev t-since-cxx17">(C++17 起)</span></td>
|
|
</tr>
|
|
<tr class="t-dcl t-since-cxx17">
|
|
<td>
|
|
<div><span class="mw-geshi cpp source-cpp"><span class="kw4">bool</span> has_filename<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span></span></div>
|
|
</td>
|
|
<td>(6)</td>
|
|
<td><span class="t-mark-rev t-since-cxx17">(C++17 起)</span></td>
|
|
</tr>
|
|
<tr class="t-dcl t-since-cxx17">
|
|
<td>
|
|
<div><span class="mw-geshi cpp source-cpp"><span class="kw4">bool</span> has_stem<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span></span></div>
|
|
</td>
|
|
<td>(7)</td>
|
|
<td><span class="t-mark-rev t-since-cxx17">(C++17 起)</span></td>
|
|
</tr>
|
|
<tr class="t-dcl t-since-cxx17">
|
|
<td>
|
|
<div><span class="mw-geshi cpp source-cpp"><span class="kw4">bool</span> has_extension<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span></span></div>
|
|
</td>
|
|
<td>(8)</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>检查路径是否含有相应路径元素。</p>
|
|
<div class="t-li1"><span class="t-li">1)</span> 检查 <a href="cpp-filesystem-path-root_path.html"><tt>root_path()</tt></a> 是否为空。</div>
|
|
<div class="t-li1"><span class="t-li">2)</span> 检查 <a href="cpp-filesystem-path-root_name.html"><tt>root_name()</tt></a> 是否为空。</div>
|
|
<div class="t-li1"><span class="t-li">3)</span> 检查 <a href="cpp-filesystem-path-root_directory.html"><tt>root_directory()</tt></a> 是否为空。</div>
|
|
<div class="t-li1"><span class="t-li">4)</span> 检查 <a href="cpp-filesystem-path-relative_path.html"><tt>relative_path()</tt></a> 是否为空。</div>
|
|
<div class="t-li1"><span class="t-li">5)</span> 检查 <a href="cpp-filesystem-path-parent_path.html"><tt>parent_path()</tt></a> 是否为空。</div>
|
|
<div class="t-li1"><span class="t-li">6)</span> 检查 <a href="cpp-filesystem-path-filename.html"><tt>filename()</tt></a> 是否为空。</div>
|
|
<div class="t-li1"><span class="t-li">7)</span> 检查 <a href="cpp-filesystem-path-stem.html"><tt>stem()</tt></a> 是否为空。</div>
|
|
<div class="t-li1"><span class="t-li">8)</span> 检查 <a href="cpp-filesystem-path-extension.html"><tt>extension()</tt></a> 是否为空。</div>
|
|
<h3><span class="mw-headline" id=".E5.8F.82.E6.95.B0">参数</span></h3>
|
|
<p>(无)</p>
|
|
<h3><span class="mw-headline" id=".E8.BF.94.E5.9B.9E.E5.80.BC">返回值</span></h3>
|
|
<p>若对应路径组分为非空则返回 <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw2">true</span></span></span> ,否则返回 <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="kw2">false</span></span></span> 。</p>
|
|
<h3><span class="mw-headline" id=".E5.BC.82.E5.B8.B8">异常</span></h3>
|
|
<p>可能抛出实现定义的异常。</p>
|
|
<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-path-empty.html"><span class="t-lines"><span>empty</span></span></a></div>
|
|
</div>
|
|
</td>
|
|
<td>检查路径是否为空<br />
|
|
<span class="t-mark">(公开成员函数)</span></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="visualClear"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|