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 
59 {
60 public:
62 
63 private:
65 
66 public:
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 
#define YF_API
Definition: Platform.h:64
#define DefGetter(_q, _t, _n,...)
Definition: YBaseMacro.h:180
std::runtime_error GeneralEvent
一般运行时异常事件类。
Definition: yexcept.h:51
std::exception Exception
YSLib 异常基类。
Definition: yexcept.h:44
#define ynothrow
YSLib 无异常抛出保证:若支持 noexcept 关键字, 指定特定的 noexcept 异常规范。
Definition: ydef.h:514
GSStringTemplate< char >::basic_string string
Definition: ycont.h:164
致命错误。
Definition: yexcept.h:87
RecordLevel
记录等级。
Definition: ycommon.h:69
记录日志的异常事件类。
Definition: yexcept.h:58
LevelType level
Definition: yexcept.h:64
const char * content
Definition: yexcept.h:90