名稱空間
變體
操作

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

來自 cppreference.com
< 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

[編輯] 異常

可能丟擲實現定義的異常。

[編輯] 示例

[編輯] 參閱

檢查路徑是否為空
(public member function) [編輯]