std::filesystem::path::has_root_path, std::filesystem::path::has_root_name, std::filesystem::path::has_root_directory

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

异常

(无)

参阅

检查路径是否为空
(公开成员函数)

版本历史

  • (当前 | 先前) 2017年5月1日 (一) 02:39Fruderica讨论 | 贡献. . (1,652字节) (+1,652). . (以“{{cpp/filesystem/path/title|has_root_path|has_root_name|has_root_directory|has_relative_path|has_parent_path|has_filename|has_stem|has_extension}} {{cpp/filesystem/p...”为内容创建页面)