YSTest
PreAlpha_b500_20140530
The YSLib Test Project
|
命名空间 | |
Devices | |
Drawing | |
图形处理。 | |
DS | |
IO | |
Messaging | |
Shells | |
Text | |
Timers | |
UI | |
类型定义 | |
using | string = GSStringTemplate< char >::basic_string |
using | ucs2string = GSStringTemplate< CHRLib::ucs2_t >::basic_string |
using | ucs4string = GSStringTemplate< CHRLib::ucs4_t >::basic_string |
using | EventPriority = u8 |
事件优先级。 更多... | |
using | Exception = std::exception |
YSLib 异常基类。 更多... | |
using | GeneralEvent = std::runtime_error |
一般运行时异常事件类。 更多... | |
using | ResourceIndex = decltype(__LINE__) |
using | ResourceMap = map< ResourceIndex, ValueObject > |
using | u8 = std::uint8_t |
通用数据类型。 更多... | |
using | u16 = std::uint16_t |
using | u32 = std::uint32_t |
using | u64 = std::uint64_t |
using | s8 = std::int8_t |
using | s16 = std::int16_t |
using | s32 = std::int32_t |
using | s64 = std::int64_t |
using | vu8 = volatile u8 |
using | vu16 = volatile u16 |
using | vu32 = volatile u32 |
using | vu64 = volatile u64 |
using | vs8 = volatile s8 |
using | vs16 = volatile s16 |
using | vs32 = volatile s32 |
using | vs64 = volatile s64 |
函数 | |
YF_API void | Execute (GUIApplication &, shared_ptr< Shell >=make_shared< Shells::GUIShell >()) |
执行程序主消息循环。 更多... | |
YB_NORETURN YF_API void | HandleFatalError (const FatalError &) ynothrow |
处理致命错误:显示错误信息并终止程序。 更多... | |
YF_API ValueNode | LoadNPLA1File (const char *disp, const char *path, ValueNode(*creator)(), bool show_info={}) |
载入 NPLA1 配置文件。 更多... | |
YF_API ValueNode | ReadConfiguration (TextFile &) |
从文本文件中读取配置。 更多... | |
YF_API void | WriteConfiguration (TextFile &, const ValueNode &) |
写入配置至文本文件。 更多... | |
YF_API ValueNode | LoadConfiguration (bool={}) |
载入默认配置。 更多... | |
YF_API void | SaveConfiguration (const ValueNode &) |
保存默认配置。 更多... | |
YF_API void | InitializeEnviornment () |
初始化环境。 更多... | |
YF_API ValueNode | InitializeInstalled () |
初始化已安装项:检查安装完整性并载入主配置文件的配置项。 更多... | |
YF_API void | InitializeSystemFontCache (Drawing::FontCache &, const string &, const string &) |
初始化系统字体缓存。 更多... | |
YF_API void | Uninitialize () ynothrow |
反初始化。 更多... | |
YF_API ValueNode & | FetchRoot () |
取值类型根节点。 更多... | |
YF_API Drawing::FontCache & | FetchDefaultFontCache () |
取默认字体缓存。 更多... | |
YF_API MIMEBiMapping & | FetchMIMEBiMapping () |
取 MIME 类型名和文件扩展名双向映射对象。 更多... | |
YF_API shared_ptr < UI::TextList::ListType > | FetchFontFamilyNames () |
取字型家族名称。 更多... | |
template<typename _type > | |
bool | reset (_type *&p) ynothrow |
template<typename _type > | |
bool | operator== (const shared_ptr< _type > &sp, _type *p) |
比较: shared_ptr 和内建指针类型的相等关系。 更多... | |
template<typename _type1 , typename _type2 > | |
bool | operator== (const weak_ptr< _type1 > &x, const weak_ptr< _type2 > &y) |
比较: weak_ptr 相等关系。 更多... | |
template<typename _type > | |
bool | operator!= (const shared_ptr< _type > &sp, _type *p) |
比较: shared_ptr 左值和内建指针类型的不等关系。 更多... | |
template<typename _type1 , typename _type2 > | |
bool | operator!= (const weak_ptr< _type1 > &x, const weak_ptr< _type2 > &y) |
比较: weak_ptr 不等关系。 更多... | |
template<class _tMap , typename _tKey , typename _fCallable , typename... _tParams> | |
auto | CacheLookup (_tMap &cache, const _tKey &key, _fCallable init, _tParams &&...args) -> decltype((cache.begin() ->second)) |
以指定的关键字查找作为缓存的无序关联容器, 若没有找到使用指定的可调用对象和参数初始化内容。 更多... | |
template<typename _fCallable > | |
void | PostTask (_fCallable &&f, Messaging::Priority prior=Messaging::NormalPriority) |
通过消息队列部署后任务。 更多... | |
template<typename _type > | |
_type * | AccessPtr (const ValueNode &node) ynothrow |
访问节点的指定类型对象指针。 更多... | |
template<typename _type > | |
_type * | AccessPtr (const ValueNode *p_node) ynothrow |
访问节点的指定类型对象指针。 更多... | |
template<typename _tString , typename... _tParams> | |
ValueNode | StringifyToNode (_tString &&name, _tParams &&...args) |
取指定名称和转换为字符串的值类型节点。 更多... | |
template<class _tPack > | |
ValueNode | UnpackToNode (_tPack &&pk) |
从参数取以指定分量为初始化参数的值类型节点。 更多... | |
template<typename... _tParams> | |
unique_ptr< ValueNode::Container > | CollectNodes (_tParams &&...args) |
取指定值类型节点为成员的节点容器。 更多... | |
template<typename _tString , typename... _tParams> | |
ValueNode | PackNodes (_tString &&name, _tParams &&...args) |
取以指定分量为参数对应初始化得到的值类型节点为子节点的值类型节点。 更多... | |
YF_API bool | IsPrefixedIndex (const string &, char= '$') |
判断字符串是否是一个指定字符和非负整数的组合。 更多... | |
YF_API Application & | FetchAppInstance () ynothrow |
取应用程序实例。 更多... | |
shared_ptr< Shell > | FetchShellHandle () ynothrow |
取当前应用程序线程空间中活动的 Shell 句柄。 更多... | |
bool | Activate (const shared_ptr< Shell > &hShl) |
激活 Shell 对象:控制权转移给此对象以维持单线程运行。 更多... | |
YF_API void | PostQuitMessage (int nExitCode, Messaging::Priority p=0xF0) |
以优先级 p 发起 Shell 终止请求,返回 nExitCode。 更多... | |
template<typename _type > | |
yconstfn _type | FetchZero () ynothrow |
取指定类型的零元素。 更多... | |
yconstfn s8 | FetchSign (int a, int b=0) ynothrow |
整数类型符号函数。 更多... | |
template<typename _type > | |
yconstfn s8 | FetchSign (const _type &a, const _type &b=FetchZero< _type >()) ynothrow |
符号函数。 更多... | |
yconstfn int | FetchSignFromInterval (int d, int a, int b) ynothrow |
判断整数 d 和以 [a, b](a ≤ b) 或 [b, a](a > b) 区间的关系。 更多... | |
template<typename _type > | |
yconstfn int | FetchSignFromInterval (const _type &d, const _type &a, const _type &b) ynothrow |
判断 d 和以 [a, b](a ≤ b) 或 [b, a](a > b) 区间的关系。 更多... | |
template<typename _type > | |
bool | IsInInterval (_type i, _type b) ynothrow |
判断 i 是否在左闭右开区间 [FetchZero<_type>() , b) 中。 更多... | |
template<typename _type > | |
bool | IsInInterval (_type i, _type a, _type b) ynothrow |
判断 i 是否在左闭右开区间 [a, b) 中。 更多... | |
template<typename _type > | |
bool | IsInClosedInterval (_type i, _type b) ynothrow |
判断 i 是否在闭区间 [FetchZero<_type>(), b] 中。 更多... | |
template<typename _type > | |
bool | IsInClosedInterval (_type i, _type a, _type b) ynothrow |
判断 i 是否在闭区间 [a, b] 中。 更多... | |
template<typename _type > | |
bool | IsInOpenInterval (_type i, _type b) ynothrow |
判断 i 是否在开区间 (FetchZero<_type>(), b) 内。 更多... | |
template<typename _type > | |
bool | IsInOpenInterval (_type i, _type a, _type b) ynothrow |
判断 i 是否在开区间 (a, b) 内。 更多... | |
template<typename _type > | |
size_t | SwitchInterval (_type v, const _type *a, size_t n) ynothrow |
计算满足指定的值 v 在区间 [a[i] , a[i + 1] ) 内最小的 i 。 更多... | |
template<typename _type > | |
size_t | SwitchAddedInterval (_type v, const _type *a, size_t n) ynothrow |
计算满足指定的值 v 在区间 [b(i), b(i + 1)) 内的最小的 i ; 其中 b(i) 是 a[i] 前 i 项的和。 更多... | |
template<typename _type > | |
void | RestrictInClosedInterval (_type &v, const _type &a, const _type &b) ynothrow |
约束 v 在闭区间 [a, b] 中。 更多... | |
template<typename _type > | |
void | RestrictInInterval (_type &i, int a, int b) ynothrow |
约束整数 i 在左闭右开区间 [a, b) 中。 更多... | |
template<typename _type > | |
void | RestrictUnsignedStrict (_type &u, unsigned b) ynothrow |
约束无符号整数 u 在区间上界 b 内。 更多... | |
template<typename _type > | |
void | RestrictUnsigned (_type &u, unsigned b) ynothrow |
约束无符号整数 u 在左闭右开区间 [0, b) 中。 更多... | |
template<typename _type > | |
void | RestrictLessEqual (_type &a, _type &b) ynothrow |
约束关系:a ≤ b 。 更多... | |
template<typename _tOut > | |
void | ClearSequence (_tOut dst, size_t n) ynothrow |
清除指定的连续对象。 更多... | |
template<typename _type > | |
yconstfn auto | CloneNonpolymorphic (const _type &p) -> decltype(&*p) |
使用 new 复制指定指针指向的对象。 更多... | |
template<class _type > | |
auto | ClonePolymorphic (const _type &p) -> decltype(&*p) |
使用 clone 成员函数复制指定指针指向的多态类类型对象。 更多... | |
template<typename... _tParams> | |
DeclDerivedI (, GIHEvent, ystdex::cloneable) DeclIEntry(size_t operator()(_tParams...) const ) DeclIEntry(GIHEvent *clone() const override) EndDecltemplate< typename > class GHEvent | |
事件处理器接口模板。 更多... | |
yconstexpr EventPriority | DefaultEventPriority (0x80) |
默认事件优先级。 更多... | |
DeclDerivedI (YF_API, IValueHolder, ystdex::any_ops::holder) DeclIEntry(bool operator | |
带等于接口的动态泛型持有者接口。 更多... | |
template<typename _type1 , typename _type2 > | |
yconstfn bool | AreEqualHeld (const _type1 &x, const _type2 &y) |
判断动态泛型的持有值是否相等。 更多... | |
template<typename _type > | |
_type | FetchInstance () |
取指定类型的无参数构造的对象。 更多... | |
template<typename _type > | |
_type & | FetchStaticRef () |
取指定类型的静态默认对象。 更多... | |
template<typename _type > | |
const _type & | FetchPrototype () |
取指定类型的静态原型对象。 更多... | |
YF_API void | AddMIMEItems (MIMEBiMapping &, const ValueNode &, MIMEBiMapping::MIMEType &&={}) |
根据 NPLA1 节点内容增加 MIME 映射。 更多... | |
DeclI (YF_API, IResource) EndDeclnamespace Drawing | |
资源接口。 更多... | |
YF_API | yimpl (GUIApplication &) FetchGlobalInstance() ynothrow |
取全局应用程序实例。 更多... | |
template<class _tApp > | |
_tApp & | FetchGlobalInstance () ynothrow |
template<class _type , class _tHandle > | |
_type & | HandleToReference (_tHandle h) ythrow(std |
句柄转换:对象引用。 更多... | |
template<class _tShell > | |
_tShell & | FetchShell () |
取指定 Shell 句柄对应的 Shell 引用 。 更多... | |
template<class _tShl > | |
shared_ptr< Shell > | FetchStored () |
取全局 Shell 句柄。 更多... | |
template<class _tShl > | |
void | ReleaseStored () |
释放全局 Shell 。 更多... | |
bool | IsNowShell (const shared_ptr< Shell > &hShl) |
判断句柄指定的 Shell 是否为当前线程空间中运行的 Shell 。 更多... | |
errno_t | NowShellTo (const shared_ptr< Shell > &hShl) |
向句柄指定的 Shell 对象转移线程控制权。 更多... | |
template<class _tShl > | |
errno_t | NowShellToNew () |
向新建 Shell 对象转移控制权。 更多... | |
template<class _tShl > | |
errno_t | NowShellToStored () |
向全局 Shell 管理器的对象转移控制权。 更多... | |
void | SetShellTo (const shared_ptr< Shell > &hShl, Messaging::Priority prior=Messaging::NormalPriority) |
通过主消息队列向指定 Shell 对象转移控制权。 更多... | |
template<class _tShl > | |
void | SetShellToNew () |
通过主消息队列向新建 Shell 对象转移控制权。 更多... | |
template<class _tShl > | |
void | SetShellToStored () |
通过主消息队列向全局 Shell 管理器内的对象转移控制权。 更多... | |
template<class _tShl > | |
void | CallStoredAtOnce () |
封装向全局 Shell 管理器内的对象转移控制权。 更多... | |
template<class _tShl > | |
void | CallStored () |
封装通过消息队列向全局 Shell 管理器内的对象转移控制权。 更多... | |
void | ResetDesktop (Desktop &dsk, Devices::Screen &scr) |
复位桌面。 更多... | |
YF_API void | RemoveGlobalTasks () |
从全局消息队列中移除所有后台消息。 更多... | |
yconstexpr const char * | DefaultTimeFormat ("%04u-%02u-%02u %02u:%02u:%02u") |
默认时间格式字符串。 更多... | |
YF_API const char * | TranslateTime (const std::tm &, const char *=DefaultTimeFormat) |
格式化时间字符串。 更多... | |
YF_API const char * | TranslateTime (const std::time_t &, const char *=DefaultTimeFormat) ythrow(GeneralEvent) |
YF_API const ValueNode & | AccessNode (const ValueNode::Container *, const string &) |
访问容器中的节点。 更多... | |
const ValueNode & | AccessNode (const ValueNode::Container &con, const string &name) |
YF_API const ValueNode * | AccessNodePtr (const ValueNode::Container &, const string &) |
访问容器中的节点指针。 更多... | |
const ValueNode * | AccessNodePtr (const ValueNode::Container *p_con, const string &name) |
const ValueNode & | UnpackToNode (const ValueNode &arg) |
从引用参数取值类型节点:返回自身。 更多... | |
ValueNode && | UnpackToNode (ValueNode &&arg) |
YF_API void | PostMessage (const Message &, Messaging::Priority) ynothrow |
全局默认队列消息发送函数。 更多... | |
void | PostMessage (Messaging::ID id, Messaging::Priority prior, const ValueObject &vo={}) ynothrow |
void | PostMessage (Messaging::ID id, Messaging::Priority prior, ValueObject &&c) ynothrow |
template<Messaging::MessageID _vID> | |
void | PostMessage (Messaging::Priority prior, const typename Messaging::SMessageMap< _vID >::TargetType &target) ynothrow |
template<typename _tRet , typename... _tParams> | |
GEvent< _tRet(_tParams...)> & | AddUnique (GEvent< _tRet(_tParams...)> &evt, const typename GEvent< _tRet(_tParams...)>::HandlerType &h, EventPriority prior=DefaultEventPriority) |
添加单一事件响应:删除后添加。 更多... | |
template<typename _tRet , typename... _tParams> | |
GEvent< _tRet(_tParams...)> & | AddUnique (GEvent< _tRet(_tParams...)> &evt, typename GEvent< _tRet(_tParams...)>::HandlerType &&h, EventPriority prior=DefaultEventPriority) |
template<typename _type , typename _tRet , typename... _tParams> | |
GEvent< _tRet(_tParams...)> & | AddUnique (GEvent< _tRet(_tParams...)> &evt, _type &&arg, EventPriority prior=DefaultEventPriority) |
template<class _type , typename _tRet , typename... _tParams> | |
GEvent< _tRet(_tParams...)> & | AddUnique (GEvent< _tRet(_tParams...)> &evt, _type &obj, _tRet(_type::*pm)(_tParams...), EventPriority prior=DefaultEventPriority) |
变量 | |
bool return | true |
yconstexpr char | BOM_UTF_16LE [] {"\xFF\xFE"} |
Unicode 编码模式标记。 更多... | |
yconstexpr char | BOM_UTF_16BE [] {"\xFE\xFF"} |
yconstexpr char | BOM_UTF_8 [] {"\xEF\xBB\xBF"} |
yconstexpr char | BOM_UTF_32LE [] {"\xFF\xFE\x00\x00"} |
yconstexpr char | BOM_UTF_32BE [] {"\x00\x00\xFE\xFF"} |
using YSLib::EventPriority = typedef u8 |
using YSLib::ResourceIndex = typedef decltype(__LINE__) |
using YSLib::ResourceMap = typedef map<ResourceIndex, ValueObject> |
using YSLib::s16 = typedef std::int16_t |
在文件 yadaptor.h 第 72 行定义.
using YSLib::s32 = typedef std::int32_t |
在文件 yadaptor.h 第 73 行定义.
using YSLib::s64 = typedef std::int64_t |
在文件 yadaptor.h 第 74 行定义.
using YSLib::s8 = typedef std::int8_t |
在文件 yadaptor.h 第 71 行定义.
using YSLib::string = typedef GSStringTemplate<char>::basic_string |
using YSLib::u16 = typedef std::uint16_t |
在文件 yadaptor.h 第 68 行定义.
using YSLib::u32 = typedef std::uint32_t |
在文件 yadaptor.h 第 69 行定义.
using YSLib::u64 = typedef std::uint64_t |
在文件 yadaptor.h 第 70 行定义.
using YSLib::u8 = typedef std::uint8_t |
using YSLib::ucs2string = typedef GSStringTemplate<CHRLib::ucs2_t>::basic_string |
using YSLib::ucs4string = typedef GSStringTemplate<CHRLib::ucs4_t>::basic_string |
using YSLib::vs16 = typedef volatile s16 |
在文件 yadaptor.h 第 80 行定义.
using YSLib::vs32 = typedef volatile s32 |
在文件 yadaptor.h 第 81 行定义.
using YSLib::vs64 = typedef volatile s64 |
在文件 yadaptor.h 第 82 行定义.
using YSLib::vs8 = typedef volatile s8 |
在文件 yadaptor.h 第 79 行定义.
using YSLib::vu16 = typedef volatile u16 |
在文件 yadaptor.h 第 76 行定义.
using YSLib::vu32 = typedef volatile u32 |
在文件 yadaptor.h 第 77 行定义.
using YSLib::vu64 = typedef volatile u64 |
在文件 yadaptor.h 第 78 行定义.
using YSLib::vu8 = typedef volatile u8 |
在文件 yadaptor.h 第 75 行定义.
const ValueNode & YSLib::AccessNode | ( | const ValueNode::Container * | p_con, |
const string & | name | ||
) |
访问容器中的节点。
在文件 ValueNode.cpp 第 90 行定义.
参考 AccessNodePtr().
参考自 AccessNode() , 以及 YSLib::ValueNode::at().
|
inline |
const ValueNode * YSLib::AccessNodePtr | ( | const ValueNode::Container & | con, |
const string & | name | ||
) |
访问容器中的节点指针。
在文件 ValueNode.cpp 第 98 行定义.
参考自 YSLib::ValueNode::AccessChildPtr(), AccessNode() , 以及 AccessNodePtr().
|
inline |
|
inline |
|
inline |
void YSLib::AddMIMEItems | ( | MIMEBiMapping & | m, |
const ValueNode & | node, | ||
MIMEBiMapping::MIMEType && | pth = {} |
||
) |
根据 NPLA1 节点内容增加 MIME 映射。
在文件 ContentType.cpp 第 62 行定义.
参考自 FetchMIMEBiMapping().
|
inline |
|
inline |
|
inline |
|
inline |
yconstfn bool YSLib::AreEqualHeld | ( | const _type1 & | x, |
const _type2 & | y | ||
) |
判断动态泛型的持有值是否相等。
参考 ystdex::examiners::equal::are_equal().
auto YSLib::CacheLookup | ( | _tMap & | cache, |
const _tKey & | key, | ||
_fCallable | init, | ||
_tParams &&... | args | ||
) | -> decltype((cache.begin()->second)) |
以指定的关键字查找作为缓存的无序关联容器, 若没有找到使用指定的可调用对象和参数初始化内容。
_tMap | 映射类型,可以是 std::map 、 std::unordered_map 或 GMRUCache 等。 |
参考 platform::Descriptions::Alert, YSLib::UI::args, YB_UNLIKELY , 以及 yforward.
参考自 YSLib::Drawing::Typeface::LookupBitmap().
|
inline |
清除指定的连续对象。
ystdex::remove_reference_t<decltype(*dst)>
, 则应满足 std::is_pod<T> || (std::is_nothrow_default_constructible<T>::value && std::is_nothrow_assignable<T, T>::value)
。 参考 YB_LIKELY.
参考自 YSLib::Drawing::ClearPixel().
yconstfn auto YSLib::CloneNonpolymorphic | ( | const _type & | p | ) | -> decltype(&*p) |
auto YSLib::ClonePolymorphic | ( | const _type & | p | ) | -> decltype(&*p) |
|
inline |
取指定值类型节点为成员的节点容器。
在文件 ValueNode.h 第 377 行定义.
参考 YSLib::UI::args, ystdex::seq_insert() , 以及 yforward.
参考自 PackNodes().
|
override |
事件处理器接口模板。
标准事件处理器类模板。
EqualityComparable
的接口,即 可使用返回 bool
的 operator==
,但此模板类无法检查其语义正确性。 YSLib::DeclDerivedI | ( | YF_API | , |
IValueHolder | , | ||
ystdex::any_ops::holder | |||
) |
带等于接口的动态泛型持有者接口。
YSLib::DeclI | ( | YF_API | , |
IResource | |||
) |
yconstexpr EventPriority YSLib::DefaultEventPriority | ( | 0x80 | ) |
默认事件优先级。
void YSLib::Execute | ( | GUIApplication & | app, |
shared_ptr< Shell > | p_shl = make_shared<Shells::GUIShell>() |
||
) |
执行程序主消息循环。
在文件 GUIApplication.cpp 第 142 行定义.
参考 Activate(), YSLib::GUIApplication::DealMessage() , 以及 YB_UNLIKELY.
参考自 main().
Application & YSLib::FetchAppInstance | ( | ) |
取应用程序实例。
在文件 GUIApplication.cpp 第 135 行定义.
参考自 Activate(), YSLib::Shells::Shell::DefShlProc(), FetchShellHandle(), YSLib::Shells::Shell::IsActive(), IsNowShell() , 以及 PostMessage().
Drawing::FontCache & YSLib::FetchDefaultFontCache | ( | ) |
取默认字体缓存。
在文件 Initialization.cpp 第 394 行定义.
参考 FetchRoot(), InitializeSystemFontCache(), YB_UNLIKELY, ydelete , 以及 ynew.
参考自 YSLib::Drawing::FetchDefaultTypeface(), FetchFontFamilyNames() , 以及 YSLib::Drawing::FontCache::GetDefaultTypefacePtr().
shared_ptr< UI::TextList::ListType > YSLib::FetchFontFamilyNames | ( | ) |
取字型家族名称。
在文件 ShellHelper.cpp 第 106 行定义.
参考 FetchDefaultFontCache() , 以及 ystdex::get_key.
|
inline |
|
inline |
MIMEBiMapping & YSLib::FetchMIMEBiMapping | ( | ) |
取 MIME 类型名和文件扩展名双向映射对象。
在文件 Initialization.cpp 第 413 行定义.
参考 AddMIMEItems(), NPL::SContext::Analyze(), FetchRoot(), NPL::LoadNPLA1(), LoadNPLA1File(), YB_UNLIKELY, ydelete , 以及 ynew.
|
inline |
ValueNode & YSLib::FetchRoot | ( | ) |
取值类型根节点。
在文件 Initialization.cpp 第 381 行定义.
参考 InitializeInstalled(), YB_UNLIKELY, ydelete , 以及 ynew.
参考自 FetchDefaultFontCache(), FetchMIMEBiMapping(), YReader::ShlReader::LoadBookmarks(), YReader::ShlReader::LoadGlobalConfiguration(), YReader::ShlReader::SaveBookmarks() , 以及 YReader::ShlReader::SaveGlobalConfiguration().
整数类型符号函数。
a < b
则返回 -1 ,否则若 a = b
则返回 0 ,否则返回 1 。 参考自 FetchSignFromInterval() , 以及 YSLib::Drawing::PlotLineSeg().
yconstfn int YSLib::FetchSignFromInterval | ( | int | d, |
int | a, | ||
int | b | ||
) |
判断整数 d 和以 [a, b](a ≤ b) 或 [b, a](a > b) 区间的关系。
参考 FetchSign().
yconstfn int YSLib::FetchSignFromInterval | ( | const _type & | d, |
const _type & | a, | ||
const _type & | b | ||
) |
判断 d 和以 [a, b](a ≤ b) 或 [b, a](a > b) 区间的关系。
参考 FetchSign().
|
inline |
yconstfn _type YSLib::FetchZero | ( | ) |
void YSLib::HandleFatalError | ( | const FatalError & | e | ) |
处理致命错误:显示错误信息并终止程序。
在文件 Initialization.cpp 第 145 行定义.
参考 platform::terminate(), platform::YDebugBegin() , 以及 platform::YDebugSetStatus().
参考自 main().
void YSLib::InitializeEnviornment | ( | ) |
初始化环境。
在文件 Initialization.cpp 第 231 行定义.
参考 platform::terminate(), platform::YConsoleInit() , 以及 yconstexpr.
参考自 YSLib::GUIApplication::GUIApplication().
ValueNode YSLib::InitializeInstalled | ( | ) |
初始化已安装项:检查安装完整性并载入主配置文件的配置项。
在文件 Initialization.cpp 第 288 行定义.
参考 LoadConfiguration() , 以及 PackNodes().
参考自 FetchRoot().
void YSLib::InitializeSystemFontCache | ( | Drawing::FontCache & | fc, |
const string & | fong_file, | ||
const string & | font_dir | ||
) |
初始化系统字体缓存。
加载默认字体文件路径和默认字体目录中的字型至默认字体缓存。
在文件 Initialization.cpp 第 311 行定义.
参考 YSLib::Drawing::FontCache::GetDefaultTypefacePtr(), YSLib::Drawing::FontCache::InitializeDefaultTypeface(), ystdex::path_norm< _type >::is_self(), YSLib::Drawing::FontCache::LoadTypefaces() , 以及 YSLib::UI::name.
|
inline |
判断 i 是否在闭区间 [FetchZero<_type>(), b] 中。
FetchZero<_type>() < b
。 参考 YAssert.
参考自 YSLib::Drawing::HSLToColor().
|
inline |
|
inline |
判断 i 是否在左闭右开区间 [FetchZero<_type>()
, b) 中。
FetchZero<_type>() < b
。 参考 YAssert.
参考自 YReader::DeclResource(), YSLib::UI::TextBox::DrawClippedText(), YSLib::UI::Menu::IsItemEnabled(), YSLib::UI::Menu::operator-=() , 以及 YSLib::UI::Menu::SetItemEnabled().
|
inline |
|
inline |
|
inline |
bool YSLib::IsPrefixedIndex | ( | const string & | name, |
char | prefix = '$' |
||
) |
判断字符串是否是一个指定字符和非负整数的组合。
在文件 ValueNode.cpp 第 107 行定义.
参考自 AddMIMEItems().
ValueNode YSLib::LoadConfiguration | ( | bool | show_info = {} | ) |
载入默认配置。
在文件 Initialization.cpp 第 211 行定义.
参考 CONF_PATH, DATA_DIRECTORY, DEF_FONT_DIRECTORY, DEF_FONT_PATH, LoadNPLA1File() , 以及 PackNodes().
参考自 InitializeInstalled() , 以及 YReader::ShlReader::LoadGlobalConfiguration().
ValueNode YSLib::LoadNPLA1File | ( | const char * | disp, |
const char * | path, | ||
ValueNode(*)() | creator, | ||
bool | show_info = {} |
||
) |
载入 NPLA1 配置文件。
show_info | 是否在标准输出中显示信息。 |
在文件 Initialization.cpp 第 159 行定义.
参考 ReadConfiguration() , 以及 platform::ufexists().
参考自 FetchMIMEBiMapping() , 以及 LoadConfiguration().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
取以指定分量为参数对应初始化得到的值类型节点为子节点的值类型节点。
在文件 ValueNode.h 第 391 行定义.
参考 YSLib::UI::args, CollectNodes(), YSLib::UI::name, UnpackToNode() , 以及 yforward.
参考自 InitializeInstalled() , 以及 LoadConfiguration().
void YSLib::PostMessage | ( | const Message & | msg, |
Messaging::Priority | prior | ||
) |
|
inline |
|
inline |
|
inline |
void YSLib::PostQuitMessage | ( | int | nExitCode, |
Messaging::Priority | p = 0xF0 |
||
) |
以优先级 p 发起 Shell 终止请求,返回 nExitCode。
参考自 platform_ex::Windows::HostWindow::HostWindow().
|
inline |
通过消息队列部署后任务。
参考 YSLib::UI::f , 以及 yforward.
参考自 YReader::ShlReader::Exit(), YReader::ShlReader::OnInput() , 以及 YSLib::Messaging::Renew().
ValueNode YSLib::ReadConfiguration | ( | TextFile & | tf | ) |
从文本文件中读取配置。
LoggedEvent | 文件无效导致的读取失败。 |
在文件 Initialization.cpp 第 186 行定义.
参考 YSLib::TextFile::Encoding, CHRLib::CharSet::UTF_8(), YB_LIKELY , 以及 YB_UNLIKELY.
参考自 LoadNPLA1File().
void YSLib::RestrictInClosedInterval | ( | _type & | v, |
const _type & | a, | ||
const _type & | b | ||
) |
void YSLib::RestrictInInterval | ( | _type & | i, |
int | a, | ||
int | b | ||
) |
约束整数 i 在左闭右开区间 [a, b) 中。
a < b
。 !(i < a) && i < b
。 参考 YAssert.
参考自 YSLib::UI::DrawTrackBackground(), YSLib::Drawing::PlotHLineSeg() , 以及 YSLib::Drawing::PlotVLineSeg().
|
inline |
约束关系:a ≤ b 。
a <= b
。 参考 ystdex::swap().
参考自 YSLib::Drawing::PlotHLineSeg() , 以及 YSLib::Drawing::PlotVLineSeg().
void YSLib::RestrictUnsigned | ( | _type & | u, |
unsigned | b | ||
) |
约束无符号整数 u 在左闭右开区间 [0, b) 中。
b != FetchZero<_type>()
。 !(u < FetchZero<_type>()) && u < b
。 参考 YAssert.
void YSLib::RestrictUnsignedStrict | ( | _type & | u, |
unsigned | b | ||
) |
void YSLib::SaveConfiguration | ( | const ValueNode & | node | ) |
保存默认配置。
在文件 Initialization.cpp 第 222 行定义.
参考 CONF_PATH , 以及 WriteConfiguration().
参考自 YReader::ShlReader::SaveGlobalConfiguration().
|
inline |
取指定名称和转换为字符串的值类型节点。
在文件 ValueNode.h 第 337 行定义.
参考 YSLib::UI::args, YSLib::UI::name, ystdex::to_string() , 以及 yforward.
size_t YSLib::SwitchAddedInterval | ( | _type | v, |
const _type * | a, | ||
size_t | n | ||
) |
计算满足指定的值 v 在区间 [b(i), b(i + 1)) 内的最小的 i ; 其中 b(i) 是 a[i]
前 i 项的和。
a
。 n != 0
。 !(v < *a)
。 参考 platform_ex::Windows::s, v , 以及 YAssert.
size_t YSLib::SwitchInterval | ( | _type | v, |
const _type * | a, | ||
size_t | n | ||
) |
void YSLib::Uninitialize | ( | ) |
反初始化。
释放初始化的资源。
在文件 Initialization.cpp 第 366 行定义.
参考 YB_LIKELY.
参考自 YSLib::GUIApplication::~GUIApplication().
|
inline |
|
inline |
在文件 ValueNode.h 第 353 行定义.
|
inline |
从参数取以指定分量为初始化参数的值类型节点。
在文件 ValueNode.h 第 365 行定义.
参考 ystdex::decay_copy() , 以及 yforward.
void YSLib::WriteConfiguration | ( | TextFile & | tf, |
const ValueNode & | node | ||
) |
写入配置至文本文件。
LoggedEvent | 文件无效导致的写入失败。 |
在文件 Initialization.cpp 第 203 行定义.
参考 YSLib::ValueNode::Value , 以及 YB_UNLIKELY.
参考自 SaveConfiguration().
YF_API YSLib::yimpl | ( | GUIApplication & | ) |
取全局应用程序实例。
yconstexpr char YSLib::BOM_UTF_16BE[] {"\xFE\xFF"} |
在文件 TextFile.h 第 48 行定义.
yconstexpr char YSLib::BOM_UTF_16LE[] {"\xFF\xFE"} |
Unicode 编码模式标记。
Unicode Encoding Scheme Signatures BOM(byte-order mark ,字节顺序标记)常量。
在文件 TextFile.h 第 47 行定义.
yconstexpr char YSLib::BOM_UTF_32BE[] {"\x00\x00\xFE\xFF"} |
在文件 TextFile.h 第 51 行定义.
yconstexpr char YSLib::BOM_UTF_32LE[] {"\xFF\xFE\x00\x00"} |
在文件 TextFile.h 第 50 行定义.
yconstexpr char YSLib::BOM_UTF_8[] {"\xEF\xBB\xBF"} |
在文件 TextFile.h 第 49 行定义.
bool return YSLib::true |
在文件 DSMain.cpp 第 177 行定义.