MGL(Win32)
読み取り中…
検索中…
一致する文字列を見つけられません
mgl_file_exception.h
[詳解]
1/* ------------------------------------------------------------------------- */
8/* ------------------------------------------------------------------------- */
9
10#ifndef INCGUARD_MGL_FILE_EXCEPTION_H_1770479526
11#define INCGUARD_MGL_FILE_EXCEPTION_H_1770479526
12
13#include <exception>
14
18
19namespace MGL::File
20{
22class Exception : public std::exception
23{
24public:
25 /* ------------------------------------------------------------------------- */
31 /* ------------------------------------------------------------------------- */
32 Exception(Error error, const char *what) noexcept
33 : _error(error)
34 , _what(Text::Format("[MGL::File::Exception] code: {}, {}", static_cast<uint32_t>(_error), what))
35 {
36 }
37
38 /* ------------------------------------------------------------------------- */
43 /* ------------------------------------------------------------------------- */
44 [[nodiscard]] constexpr Error GetError() const noexcept
45 {
46 return _error;
47 }
48
49 /* ------------------------------------------------------------------------- */
54 /* ------------------------------------------------------------------------- */
55 [[nodiscard]] const char *what() const noexcept override
56 {
57 return _what.c_str();
58 }
59
60private:
61 Error _error;
62 STL::string _what;
63};
64} // namespace MGL::File
65
66#endif // INCGUARD_MGL_FILE_EXCEPTION_H_1770479526
67
68// vim: et ts=4 sw=4 sts=4
ファイルシステム用例外クラス
Definition mgl_file_exception.h:23
constexpr Error GetError() const noexcept
エラーコードの取得
Definition mgl_file_exception.h:44
const char * what() const noexcept override
理由の取得
Definition mgl_file_exception.h:55
Exception(Error error, const char *what) noexcept
コンストラクタ
Definition mgl_file_exception.h:32
MGL ファイル用各種定義
Error
エラー定義
Definition mgl_file_defs.h:71
MGL STL文字列クラスの代替
basic_string< char > string
std::stringの代替
Definition mgl_stl_string.h:25
MGL テキストフォーマット