檔案狀態類別

包裝 file_type 和檔案的 perms。

語法

class file_status;

建構函式

建構函式 描述
file_status 建構file_type和檔案perms的包裝函式。

成員函式

成員函數 描述
type 取得或設定 file_type。
permissions 取得或設定檔案權限。

操作員

運算子 描述
operator= 預設成員指派運算子會如預期般運作。

需求

標頭:<filesystem>

命名空間:std::filesystem

file_status::file_status

建構file_type和檔案perms的包裝函式。

explicit file_status(
   file_type ftype = file_type::none,
   perms mask = perms::unknown) noexcept;

file_status(const file_status&) noexcept = default;

file_status(file_status&&) noexcept = default;

~file_status() noexcept = default;

參數

ftype
指定的 file_type,預設為 file_type::none。

面具
指定的檔案 perms,預設為 perms::unknown。

file_status
預存物件。

file_status::operator=

預設成員指派運算子會如預期般運作。

file_status& operator=(const file_status&) noexcept = default;
file_status& operator=(file_status&&) noexcept = default;

參數

file_status
要file_status。

型別

取得或設定 file_type。

file_type type() const noexcept;
void type(file_type ftype) noexcept;

參數

ftype
已指定 file_type。

使用權限

取得或設定檔案權限。

使用 setter 建立檔案 readonly 或移除 readonly 屬性。

perms permissions() const noexcept;
void permissions(perms mask) noexcept;

參數

面具
已指定 perms。

另請參閱

標頭檔參考
path 類別
<檔案系統>