YSTest: yexcept.h 源文件

YSTest PreAlpha_b500_20140530 The YSLib Test Project

- 首页
- 相关页面
- 模块
- 命名空间
- 类
- 文件

- 文件列表
- 文件成员

全部 类 命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义 组 页
yexcept.h
浏览该文件的文档.
1 /*
2 © 2010-2014 FrankHB.
3
4 This file is part of the YSLib project, and may only be used,
5 modified, and distributed under the terms of the YSLib project
6 license, LICENSE.TXT. By continuing to use, modify, or distribute
7 this file you indicate that you have read the license and
8 understand and accept it fully.
9 */
10
28 #ifndef YSL_INC_Core_yexcept_h_
29 #define YSL_INC_Core_yexcept_h_ 1
30
31 #include "YModules.h"
32 #include YFM_YSLib_Core_YShellDefinition
33 #include <exception>
34 #include <stdexcept>
35 #include <string>
36
37 namespace YSLib
38 {
39
44 using Exception = std::exception;
45
46
51 using GeneralEvent = std::runtime_error;
52
53
58 class YF_API LoggedEvent : public GeneralEvent
59 {
60 public:
61 using LevelType = RecordLevel;
62
63 private:
64 LevelType level;
65
66 public:
71 LoggedEvent(const std::string&, LevelType = Emergent) ynothrow;
76 LoggedEvent(const GeneralEvent&, LevelType = Emergent) ynothrow;
77
78 DefGetter(const ynothrow, LevelType, Level, level)
79 };
80
81
87 class YF_API FatalError : public GeneralEvent
88 {
89 private:
90 const char* content;
91
92 public:
94 FatalError(const char*, const char*) ynothrow;
95
96 DefGetter(const ynothrow, const char*, Content, content)
97 DefGetter(const ynothrow, const char*, Title, what())
98 };
99
100 } // namespace YSLib;
101
102 #endif
103
YModules.h
YF_API
#define YF_API
Definition: Platform.h:64
DefGetter
#define DefGetter(_q, _t, _n,...)
Definition: YBaseMacro.h:180
YSLib::GeneralEvent
std::runtime_error GeneralEvent
一般运行时异常事件类。
Definition: yexcept.h:51
YSLib::Exception
std::exception Exception
YSLib 异常基类。
Definition: yexcept.h:44
ynothrow
#define ynothrow
YSLib 无异常抛出保证：若支持 noexcept 关键字， 指定特定的 noexcept 异常规范。
Definition: ydef.h:514
YSLib::string
GSStringTemplate< char >::basic_string string
Definition: ycont.h:164
YSLib::FatalError
致命错误。
Definition: yexcept.h:87
platform::Descriptions::RecordLevel
RecordLevel
记录等级。
Definition: ycommon.h:69
platform::Descriptions::Emergent
Definition: ycommon.h:71
YSLib::LoggedEvent
记录日志的异常事件类。
Definition: yexcept.h:58
YSLib::LoggedEvent::level
LevelType level
Definition: yexcept.h:64
YSLib::FatalError::content
const char * content
Definition: yexcept.h:90