一個用於所有報告低階系統錯誤例外的基底類別。
語法
class filesystem_error : public system_error;
備註
此類別作為所有報告函式錯誤 <filesystem> 的例外的基底類別。 它儲存一個 string 物件,本文為 mymesg 說明清楚起見稱之為物件。 它同時儲存兩個 path 物件,稱為 mypval1 和 mypval2。
成員
建構函式
| 名稱 | 描述 |
|---|---|
filesystem_error |
filesystem_error建構訊息。 |
Functions
| 名稱 | 描述 |
|---|---|
path1 |
傳回 mypval1。 |
path2 |
傳回 mypval2。 |
what |
傳回 NTBS 的指標。 |
需求
標頭:<filesystem>
命名空間:std::filesystem
filesystem_error
第一個構造子從 what_arg 和 ec建立訊息。 第二個構造子同樣從 pval1建構其訊息,並將其儲存在 mypval1中。 第三個構造子同樣從 建立訊息pval1,將其儲存在 mypval1,並pval2mypval2從 儲存在 。
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
進一步指定的訊息參數。
path1
此成員函式會傳回 mypval1
const path& path1() const noexcept;
path2
此成員函式會傳回 mypval2
const path& path2() const noexcept;
what
成員函式會傳回 的指標 NTBS,最好是從 runtime_error::what()、 system_error::what()、、 mymesg、 mypval1.native_string()和 mypval2.native_string()組成。
const char *what() const noexcept;