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
From cppreference.net
<
cpp
|
filesystem
|
path
|
bool
has_root_path
(
)
const
;
|
(1) | (自 C++17 起) |
|
bool
has_root_name
(
)
const
;
|
(2) | (自 C++17 起) |
|
bool
has_root_directory
(
)
const
;
|
(3) | (自 C++17 起) |
|
bool
has_relative_path
(
)
const
;
|
(4) | (自 C++17 起) |
|
bool
has_parent_path
(
)
const
;
|
(5) | (自 C++17 起) |
|
bool
has_filename
(
)
const
;
|
(6) | (自 C++17 起) |
|
bool
has_stem
(
)
const
;
|
(7) | (自 C++17 起) |
|
bool
has_extension
(
)
const
;
|
(8) | (自 C++17 起) |
检查路径是否包含对应的路径元素。
1)
检查
root_path()
是否为空。
2)
检查
root_name()
是否为空。
3)
检查
root_directory()
是否为空。
4)
检查
relative_path()
是否为空。
5)
检查
parent_path()
是否为空。
6)
检查
filename()
是否为空。
7)
检查
stem()
是否为空。
8)
检查
extension()
是否为空。
目录 |
参数
(无)
返回值
当对应的路径组件不为空时返回 true ,否则返回 false 。
异常
可能抛出实现定义的异常。
示例
|
本节内容不完整
原因:缺少示例 |
参见
|
检查路径是否为空
(公开成员函数) |