YSTest  PreAlpha_b500_20140530
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
yadaptor.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_Adaptor_yadaptor_h_
29 #define YSL_INC_Adaptor_yadaptor_h_ 1
30 
31 #include "YModules.h"
32 
33 //引入平台设置和存储调试设施。
34 #include YFM_YSLib_Adaptor_YNew
35 
36 // 确保包含标准库必要部分。
37 #include <cmath>
38 #include <algorithm> // for std::min, std::max;
39 
40 //包含 YStandardEx 公用部分。
41 #include <ystdex/functional.hpp>
42 #include <ystdex/utility.hpp>
43 #include <ystdex/string.hpp> // for std::to_string, ystdex::to_string;
44 
45 //包含 YCLib 公用部分。
46 #include YFM_YCLib_YCommon
47 #include YFM_YCLib_Debug
48 #include YFM_YCLib_Keys
49 #include YFM_YCLib_Timer
50 #include YFM_YCLib_FileSystem
51 #include YFM_YCLib_Video
52 
53 /*
54 !\brief YSLib 命名空间。
55 \since 早于 build 132
56 */
57 namespace YSLib
58 {
59 
60 //目标平台中立接口。
61 
67 using u8 = std::uint8_t;
68 using u16 = std::uint16_t;
69 using u32 = std::uint32_t;
70 using u64 = std::uint64_t;
71 using s8 = std::int8_t;
72 using s16 = std::int16_t;
73 using s32 = std::int32_t;
74 using s64 = std::int64_t;
75 using vu8 = volatile u8;
76 using vu16 = volatile u16;
77 using vu32 = volatile u32;
78 using vu64 = volatile u64;
79 using vs8 = volatile s8;
80 using vs16 = volatile s16;
81 using vs32 = volatile s32;
82 using vs64 = volatile s64;
84 
90 using ystdex::seq_apply;
93 
101 using ystdex::nonmovable;
102 using ystdex::nullptr_t;
104 
112 using ::round;
114 
120 using std::min;
121 using std::max;
122 //}
123 
125 
126 using ystdex::arrlen;
129 using std::to_string;
131 using ystdex::to_string;
133 
134 
135 //非目标平台中立接口。
136 
142 using ystdex::byte;
145 using ystdex::octet;
146 using ystdex::errno_t;
147 using ystdex::ptrdiff_t;
148 using ystdex::size_t;
150 using ystdex::wint_t;
152 
153 
158 using namespace platform::Descriptions;
159 
165 
166 
172 using platform::ufopen;
173 using platform::ufexists;
177 using platform::uchdir;
179 using platform::umkdir;
181 using platform::urmdir;
183 using platform::uunlink;
185 using platform::uremove;
187 using platform::truncate;
189 
190 //系统处理函数。
191 using platform::terminate;
192 
193 //基本图形定义。
194 using platform::SPos;
195 using platform::SDst;
196 
197 //基本输出接口。
198 using platform::InitVideo;
199 
200 //计时器和时钟。
201 using platform::GetTicks;
204 
205 //输入类型。
207 using platform::KeyIndex;
209 using platform::KeyBitsetWidth;
210 using platform::KeyInput;
212 namespace KeyCategory = platform::KeyCategory;
213 namespace KeyCodes = platform::KeyCodes;
214 
221 
223 namespace Drawing
224 {
225 
227 using platform::BGRA;
229 using platform::RGBA;
230 using platform::PixelType;
231 using platform::BitmapPtr;
237 using platform::FetchAlpha;
238 using platform::FetchOpaque;
240 
242 using platform::MonoType;
243 using platform::AlphaType;
245 using platform::Color;
246 namespace ColorSpace = platform::ColorSpace;
247 
248 } // namespace Drawing;
249 
250 namespace IO
251 {
252 //文件系统抽象。
257 using platform::NativePathCharType;
259 using platform::CS_Path;
260 
262 
266 
268 
276 
277 } // namespace IO;
278 
279 } // namespace YSLib;
280 
281 #endif
282 
YF_API void StartTicks()
开始 tick 计时。
Definition: Timer.cpp:102
char16_t * u16getcwd_n(char16_t *buf, std::size_t size) ynothrow
实用设施。
ISO C++ 标准字符串扩展。
PathCategory
路径类别。
yconstexpr MapKeyChar
Definition: Keys.h:190
YF_API bool InitVideo()
初始化视频输出。
Definition: Video.cpp:133
YF_API bool IsAbsolute(const char *)
判断指定路径字符串是否表示一个绝对路径。
std::int16_t s16
Definition: yadaptor.h:72
YF_API bool truncate(std::FILE *, std::size_t) ynothrow
截断文件至指定长度。
YF_API std::size_t GetRootNameLength(const char *)
取指定路径的文件系统根节点名称的长度。
std::size_t KeyIndex
按键索引类型:标识特定的按键在按键集合中的位置。
Definition: Keys.h:42
std::uint32_t u32
Definition: yadaptor.h:69
std::uint64_t u64
Definition: yadaptor.h:70
size_t arrlen(_type(&)[_vN])
计算指定数组类型对象的长度。
Definition: utility.hpp:196
YF_API bool ufexists(const char *) ynothrow
判断指定 UTF-8 文件名的文件是否存在。
unsigned char byte
字节类型。
Definition: ydef.h:555
void unseq_apply(_fCallable &&f, _tParams &&...args)
无序调用。
Definition: functional.hpp:144
std::uint16_t SDst
屏幕坐标距离。
Definition: Video.h:39
std::int64_t s64
Definition: yadaptor.h:74
std::int16_t SPos
屏幕坐标度量。
Definition: Video.h:38
union _vA::IntegerType RGBA
Definition: Video.h:142
volatile s16 vs16
Definition: yadaptor.h:80
void seq_apply(_fCallable &&)
顺序递归调用。
Definition: functional.hpp:125
目录句柄:表示打开的目录和内容迭代状态。
YB_NORETURN YF_API void terminate() ynothrow
异常终止函数。
Definition: ycommon.cpp:39
YF_API bool uchdir(const char *) ynothrow
切换当前工作路径至指定的 UTF-8 字符串。
YF_API bool urmdir(const char *) ynothrow
按 UTF-8 路径删除一个空目录。
不可复制对象:禁止派生类调用默认原型的复制构造函数和复制赋值操作符。
Definition: utility.hpp:75
union _vA::IntegerType BGRA
Definition: Video.h:89
volatile u32 vu32
Definition: yadaptor.h:77
volatile u8 vu8
Definition: yadaptor.h:75
YF_API std::uint64_t GetHighResolutionTicks()
取高精度 tick 数。
Definition: Timer.cpp:157
ystdex::octet MonoType
Definition: Video.h:185
空指针类。
Definition: ydef.h:583
std::int8_t s8
Definition: yadaptor.h:71
YF_API KeyIndex FindFirstKey(const KeyInput &) ynothrow
找到输入缓冲区记录中最小的按键编码。
Definition: Keys.cpp:36
YF_API std::FILE * ufopen(const char *filename, const char *mode) ynothrow
以 UTF-8 文件名打开文件。
volatile u64 vu64
Definition: yadaptor.h:78
目录会话:表示打开的目录。
YF_API bool uunlink(const char *) ynothrow
按 UTF-8 路径删除一个非目录文件。
YF_API std::uint32_t GetTicks()
取 tick 数。
Definition: Timer.cpp:141
volatile s8 vs8
Definition: yadaptor.h:79
ystdex::indirect_input_iterator< HDirectory * > FileIterator
文件迭代器。
YF_API bool uremove(const char *) ynothrow
按 UTF-8 路径删除一个文件。
YF_API bool umkdir(const char *) ynothrow
按 UTF-8 路径以默认权限新建一个目录。
std::string to_string(unsigned char val)
转换为字符串。
Definition: string.hpp:353
Color
控制台颜色枚举。
Definition: Video.h:458
std::uint8_t u8
通用数据类型。
Definition: yadaptor.h:67
std::int32_t s32
Definition: yadaptor.h:73
int errno_t
Definition: ydef.h:568
PixelType * BitmapPtr
Definition: Video.h:295
表示文件操作失败的异常。
YF_API KeyIndex FindNextKey(const KeyInput &, KeyIndex) ynothrow
找到输入缓冲区记录中大于指定编码的最小的按键编码。
Definition: Keys.cpp:46
volatile u16 vu16
Definition: yadaptor.h:76
std::uint16_t u16
Definition: yadaptor.h:68
volatile s64 vs64
Definition: yadaptor.h:82
const PixelType * ConstBitmapPtr
Definition: Video.h:296
NodeCategory
文件系统节点类别。
void octet
Definition: ydef.h:565
volatile s32 vs32
Definition: yadaptor.h:81
std::bitset< KeyBitsetWidth > KeyInput
按键并行位宽。
Definition: Keys.h:68
ystdex::octet AlphaType
Definition: Video.h:186
函数和可调用对象。