YSTest
PreAlpha_b400_20130424
The YSLib Test Project
首页
相关页面
模块
命名空间
类
文件
文件列表
文件成员
全部
类
命名空间
文件
函数
变量
类型定义
枚举
枚举值
友元
宏定义
组
页
ycommon.h
浏览该文件的文档.
1
/*
2
Copyright by FrankHB 2009 - 2013.
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
32
#ifndef YCL_INC_ycommon_h_
33
#define YCL_INC_ycommon_h_ 1
34
35
//平台定义。
36
#include "
Platform.h
"
37
38
//平台无关部分。
39
#include <
ydef.h
>
40
#include <
ystdex/cstdio.h
>
41
#include <cstdlib>
42
#include <string>
43
44
//平台相关部分。
45
//#include <unistd.h>
46
48
namespace
platform
49
{
50
55
YB_NORETURN
YF_API
void
56
terminate
()
ynothrow
;
57
58
59
//断言。
60
#ifdef YB_USE_YASSERT
61
62
#undef YAssert
63
68
YF_API
void
69
yassert(
bool
,
const
char
*,
const
char
*,
int
,
const
char
*);
70
71
#define YAssert(exp, message) \
72
platform::yassert(exp, #exp, message, __LINE__, __FILE__)
73
74
#else
75
76
#include <cassert>
77
# define YAssert(exp, message) assert(exp)
78
79
#endif
80
81
}
// namespace platform;
82
83
namespace
platform_ex
84
{
85
86
#if YCL_DS
87
95
YF_API
bool
96
AllowSleep
(
bool
);
97
98
#elif YCL_MINGW32
99
// TODO: Add more Windows specific APIs.
100
102
103
YF_API
std::string
104
UTF8ToMBCS(
const
char
*, std::size_t,
int
);
105
inline
std::string
106
UTF8ToMBCS(
const
std::string
& str,
int
cp)
107
{
108
return
UTF8ToMBCS(str.c_str(), str.length(), cp);
109
}
110
111
YF_API
std::string
112
WCSToMBCS(
const
wchar_t
*, std::size_t,
int
);
113
inline
std::string
114
WCSToMBCS(
const
std::wstring& str,
int
cp)
115
{
116
return
WCSToMBCS(str.c_str(), str.length(), cp);
117
}
119
120
#else
121
# error Unsupport platform found!
122
#endif
123
124
}
// namespace platform_ex;
125
126
#endif
127
YFramework
include
YCLib
ycommon.h
生成于 2013年 四月 24日 星期三 18:41:28 , 为 YSTest使用
1.8.2