<experimental/filesystem> filesystem_error級

Important

本文描述了 的filesystem_error預標準<experimental/filesystem>實作。 它記錄的是歷史檔案系統技術規範(ISO/IEC JTC 1/SC 22/WG 21 N4100),而非 C++17 std::filesystem::filesystem_error 類別。 實驗性實作自 MSVC 14.51 版本起被移除。 目前程式碼請使用標準 的 filesystem_error 類。

一個基底類別,用於拋出所有用來報告低階系統錯誤的例外。

語法

class filesystem_error : public system_error;

註解

這個類別作為所有用來報告 <實驗/檔案系統> 錯誤的例外的基底類別。 它儲存一個類型的 string物件,這裡稱為 mymesg ,以便說明。 它同時儲存兩個類型為 path的物件,稱為 mypval1 和 mypval2。

Members

建構函數

Name Description
filesystem_error 構建訊息 filesystem_error 。

Functions

Name Description
路徑1 傳回 mypval1。
路徑2 傳回 mypval2。
什麼 回傳指標到 NTBS。

Requirements

標題:<實驗/檔案系統>

命名空間: std::experimental::filesystem

filesystem_error

第一個建構子從 what_arg 和 ec 構建訊息。 第二個建構子同樣從 pval1 構造其訊息,並將其儲存在 mypval1。 第三個構造子同樣從 pval1 構造其訊息,該訊息儲存在 mypval1,以及從 pval2 構造其訊息,該 pval2 儲存在 mypval2。

filesystem_error(const string& what_arg,
    error_code ec);

filesystem_error(const string& what_arg,
    const path& pval1,
    error_code ec);

filesystem_error(const string& what_arg,
    const path& pval1,
    const path& pval2,
    error_code ec);

參數

what_arg
指定訊息。

EC
指定錯誤代碼。

mypval1
進一步指定訊息參數。

MyPval2
進一步指定訊息參數。

路徑1

成員函數回傳 mypval1

const path& path1() const noexcept;

路徑2

成員函數回傳 mypval2

const path& path2() const noexcept;

什麼

成員函數回傳指向 NTBS的指標,最好由 runtime_error::what()、 system_error::what()、 mymesg、 mypval1.native_string()和 mypval2.native_string()組成。

const char *what() const noexcept;

參見

<experimental/filesystem>
path 類別