YSTest
PreAlpha_b500_20140530
The YSLib Test Project
|
默认平台命名空间。 更多...
命名空间 | |
ColorSpace | |
系统默认颜色空间。 | |
Consoles | |
控制台接口。 | |
Descriptions | |
平台描述空间。 | |
KeyCategory | |
类 | |
class | Color |
颜色。 更多... | |
class | DirectorySession |
目录会话:表示打开的目录。 更多... | |
class | FileOperationFailure |
表示文件操作失败的异常。 更多... | |
class | HDirectory |
目录句柄:表示打开的目录和内容迭代状态。 更多... | |
class | Logger |
日志记录器。 更多... | |
class | MappedFile |
只读内存映射文件。 更多... | |
struct | XYZATrait |
XYZA 特征。 更多... | |
类型定义 | |
using | FileIterator = ystdex::indirect_input_iterator< HDirectory * > |
文件迭代器。 更多... | |
using | KeyIndex = std::size_t |
按键索引类型:标识特定的按键在按键集合中的位置。 更多... | |
using | KeyInput = std::bitset< KeyBitsetWidth > |
按键并行位宽。 更多... | |
using | SPos = std::int16_t |
屏幕坐标度量。 更多... | |
using | SDst = std::uint16_t |
屏幕坐标距离。 更多... | |
using | BitmapPtr = PixelType * |
using | ConstBitmapPtr = const PixelType * |
using | MonoType = ystdex::octet |
using | AlphaType = ystdex::octet |
枚举 | |
enum | PathCategory : yimpl(std::uint32_t) { PathCategory::Empty, PathCategory::Self, PathCategory::Parent, PathCategory::Node } |
路径类别。 更多... | |
enum | NodeCategory : ystdex::underlying_type_t< PathCategory > { NodeCategory::Empty = ystdex::underlying_type_t<PathCategory>(PathCategory::Empty), NodeCategory::Unknown = ystdex::underlying_type_t<PathCategory>(PathCategory::Node), NodeCategory::Missing, NodeCategory::Invalid, NodeCategory::Regular, NodeCategory::Directory, NodeCategory::Device = 0x1000, NodeCategory::Block, NodeCategory::Character, NodeCategory::yimpl, NodeCategory::FIFO, NodeCategory::Socket, NodeCategory::yimpl, NodeCategory::SymbolicLink, NodeCategory::HardLink, NodeCategory::Junction, NodeCategory::Special = 0x4000, NodeCategory::yimpl =() } |
文件系统节点类别。 更多... | |
函数 | |
YF_API Logger & | FetchCommonLogger () |
取公共日志记录器。 更多... | |
YF_API int | uopen (const char *filename, int oflag) ynothrow |
以 UTF-8 文件名无缓冲打开文件。 更多... | |
YF_API int | uopen (const char *filename, int oflag, int pmode) ynothrow |
以 UTF-8 文件名无缓冲打开文件。 更多... | |
YF_API int | uopen (const char16_t *filename, int oflag) ynothrow |
以 UCS-2 文件名无缓冲打开文件。 更多... | |
YF_API int | uopen (const char16_t *filename, int oflag, int pmode) ynothrow |
以 UCS-2 文件名无缓冲打开文件。 更多... | |
YF_API std::FILE * | ufopen (const char *filename, const char *mode) ynothrow |
以 UTF-8 文件名打开文件。 更多... | |
YF_API std::FILE * | ufopen (const char16_t *filename, const char16_t *mode) ynothrow |
以 UCS-2 文件名打开文件。 更多... | |
YF_API bool | ufexists (const char *) ynothrow |
判断指定 UTF-8 文件名的文件是否存在。 更多... | |
YF_API bool | ufexists (const char16_t *) ynothrow |
判断指定 UCS-2 文件名的文件是否存在。 更多... | |
template<class _tString > | |
PDefH (bool, ufexists, const _tString &str) ynothrow ImplRet(ufexists(str.c_str())) YF_API char16_t *u16getcwd_n(char16_t *buf | |
判断指定字符串为文件名的文件是否存在。 更多... | |
YF_API bool | IsAbsolute (const char *) |
判断指定路径字符串是否表示一个绝对路径。 更多... | |
YF_API std::size_t | GetRootNameLength (const char *) |
取指定路径的文件系统根节点名称的长度。 更多... | |
YF_API void | WaitForInput () |
等待任意按键。 更多... | |
YF_API KeyIndex | FindFirstKey (const KeyInput &) ynothrow |
找到输入缓冲区记录中最小的按键编码。 更多... | |
YF_API KeyIndex | FindNextKey (const KeyInput &, KeyIndex) ynothrow |
找到输入缓冲区记录中大于指定编码的最小的按键编码。 更多... | |
YF_API void | StartTicks () |
开始 tick 计时。 更多... | |
YF_API std::uint32_t | GetTicks () |
取 tick 数。 更多... | |
YF_API std::uint64_t | GetHighResolutionTicks () |
取高精度 tick 数。 更多... | |
template<size_t _vB, size_t _vG, size_t _vR, size_t _vA> | |
union | YB_ATTR (packed) YB_ATTR(aligned(yalignof(typename XYZATrait< _vB |
BGRA 四元组。 更多... | |
DefDeCtor (BGRA) yconstfn BGRA(typename Trait | |
yconstfn | BGRA (typename Trait::BType b, typename Trait::GType g, typename Trait::RType r, typename Trait::AType a) |
yconstfn | DefCvt (const ynothrow, typename Trait::IntegerType, Integer) yconstfn DefGetter(const ynothrow |
yconstfn Integer &Trait::AMask Trait::XYZBitsN yconstfn | DefGetter (const ynothrow, typename Trait::BType, B, Integer &Trait::XMask) yconstfn DefGetter(const ynothrow |
yconstfn Integer &Trait::AMask Trait::XYZBitsN yconstfn Integer &Trait::YMask Trait::XBitsN yconstfn | DefGetter (const ynothrow, typename Trait::RType, R,(Integer &Trait::ZMask) >> Trait::XYBitsN)} |
DefDeCtor (RGBA) yconstfn RGBA(typename Trait | |
yconstfn | RGBA (typename Trait::BType r, typename Trait::GType g, typename Trait::RType b, typename Trait::AType a) |
yconstfn Integer &Trait::AMask Trait::XYZBitsN yconstfn | DefGetter (const ynothrow, typename Trait::BType, B,(Integer &Trait::ZMask) >> Trait::XYBitsN) yconstfn DefGetter(const ynothrow |
yconstfn Integer &Trait::AMask Trait::XYZBitsN yconstfn Integer &Trait::YMask Trait::XBitsN yconstfn | DefGetter (const ynothrow, typename Trait::RType, R, Integer &Trait::XMask)} |
YF_API void | YConsoleInit (std::uint8_t dspIndex, Color fc=ColorSpace::White, Color bc=ColorSpace::Black) |
启动控制台。 更多... | |
YF_API bool | InitVideo () |
初始化视频输出。 更多... | |
YB_NORETURN YF_API void | terminate () ynothrow |
异常终止函数。 更多... | |
std::string | LogWithSource (const char *file, int line, const char *fmt,...) |
char16_t * | u16getcwd_n (char16_t *buf, std::size_t size) ynothrow |
YF_API void | YDebugSetStatus (bool=true) |
调试模式:设置状态。 更多... | |
YF_API bool | YDebugGetStatus () |
调试模式:取得状态。 更多... | |
YF_API void | YDebugBegin () |
调试模式:显示控制台。 更多... | |
YF_API void | YDebug () |
调试模式:按键继续。 更多... | |
YF_API void | YDebug (const char *) |
调试模式:显示控制台字符串,按键继续。 更多... | |
YF_API int | yprintf (const char *,...) |
调试模式 printf :显示控制台格式化输出 ,按键继续。 更多... | |
YF_API bool | uchdir (const char *) ynothrow |
切换当前工作路径至指定的 UTF-8 字符串。 更多... | |
YF_API bool | umkdir (const char *) ynothrow |
按 UTF-8 路径以默认权限新建一个目录。 更多... | |
YF_API bool | urmdir (const char *) ynothrow |
按 UTF-8 路径删除一个空目录。 更多... | |
YF_API bool | uunlink (const char *) ynothrow |
按 UTF-8 路径删除一个非目录文件。 更多... | |
YF_API bool | uremove (const char *) ynothrow |
按 UTF-8 路径删除一个文件。 更多... | |
YF_API bool | truncate (std::FILE *, std::size_t) ynothrow |
截断文件至指定长度。 更多... | |
YF_API std::uint64_t | GetFileSizeOf (int) |
取文件的大小。 更多... | |
YF_API std::uint64_t | GetFileSizeOf (std::FILE *) |
变量 | |
std::size_t size | ynothrow |
union _vA::IntegerType | BGRA |
Trait::ArrayType | Bytes |
Trait::IntegerType | Integer |
yconstfn | A |
yconstfn Integer &Trait::AMask Trait::XYZBitsN yconstfn | G |
union _vA::IntegerType | RGBA |
fd | |
if(p==MAP_FAILED) throw std | addr = static_cast<ystdex::byte*>(p) |
yconstexpr | MapKeyChar |
yconstexpr | PDefH (char, MapKeyChar, KeyIndex) ynothrow ImplRet(char()) yconstexpr PDefH(char |
映射按键到键入的字符。 更多... | |
yconstexpr const KeyInput KeyIndex ynothrow | ImplRet (char()) namespace KeyCodes |
本机按键编码。 更多... | |
默认平台命名空间。
using platform::AlphaType = typedef ystdex::octet |
using platform::BitmapPtr = typedef PixelType* |
using platform::ConstBitmapPtr = typedef const PixelType* |
using platform::FileIterator = typedef ystdex::indirect_input_iterator<HDirectory*> |
using platform::KeyIndex = typedef std::size_t |
using platform::KeyInput = typedef std::bitset<KeyBitsetWidth> |
using platform::MonoType = typedef ystdex::octet |
using platform::SDst = typedef std::uint16_t |
using platform::SPos = typedef std::int16_t |
|
strong |
文件系统节点类别。
在文件 YCLib/FileSystem.h 第 343 行定义.
|
strong |
yconstfn platform::BGRA | ( | typename Trait::BType | b, |
typename Trait::GType | g, | ||
typename Trait::RType | r, | ||
typename Trait::AType | a | ||
) |
yconstfn Integer& Trait::AMask Trait::XYZBitsN yconstfn platform::DefGetter | ( | const ynothrow | , |
typename Trait::BType | , | ||
B | , | ||
Integer &Trait::XMask | |||
) | const |
yconstfn Integer& Trait::AMask Trait::XYZBitsN yconstfn Integer& Trait::YMask Trait::XBitsN yconstfn platform::DefGetter | ( | const ynothrow | , |
typename Trait::RType | , | ||
R | , | ||
(Integer &Trait::ZMask) >> Trait::XYBitsN | |||
) |
yconstfn Integer& Trait::AMask Trait::XYZBitsN yconstfn platform::DefGetter | ( | const ynothrow | , |
typename Trait::BType | , | ||
B | , | ||
(Integer &Trait::ZMask) >> Trait::XYBitsN | |||
) | const |
yconstfn Integer& Trait::AMask Trait::XYZBitsN yconstfn Integer& Trait::YMask Trait::XBitsN yconstfn platform::DefGetter | ( | const ynothrow | , |
typename Trait::RType | , | ||
R | , | ||
Integer &Trait::XMask | |||
) |
Logger & platform::FetchCommonLogger | ( | ) |
KeyIndex platform::FindFirstKey | ( | const KeyInput & | keys | ) |
找到输入缓冲区记录中最小的按键编码。
参考自 platform::KeyCategory::FindFirstKeyInCategroy().
KeyIndex platform::FindNextKey | ( | const KeyInput & | keys, |
KeyIndex | key | ||
) |
找到输入缓冲区记录中大于指定编码的最小的按键编码。
参考自 platform::KeyCategory::FindFirstKeyInCategroy().
std::uint64_t platform::GetFileSizeOf | ( | int | fd | ) |
取文件的大小。
FileOperationFailure | 参数无效或文件大小查询失败。 |
errno
在出错时会被设置。 在文件 YCLib/FileSystem.cpp 第 437 行定义.
参考 YB_LIKELY.
参考自 GetFileSizeOf() , 以及 platform::MappedFile::MappedFile().
std::uint64_t platform::GetFileSizeOf | ( | std::FILE * | fp | ) |
std::uint64_t platform::GetHighResolutionTicks | ( | ) |
取高精度 tick 数。
参考 StartTicks().
参考自 YSLib::Timers::HighResolutionClock::now() , 以及 YSLib::FPSCounter::Refresh().
std::size_t platform::GetRootNameLength | ( | const char * | path | ) |
std::uint32_t platform::GetTicks | ( | ) |
yconstexpr const KeyInput KeyIndex ynothrow platform::ImplRet | ( | char() | ) |
本机按键编码。
取锁定键状态。
切换锁定键状态。
参考 A, Empty, YSLib::Drawing::X, YSLib::Drawing::Y, yconstexpr, YF_API , 以及 ynothrow.
bool platform::IsAbsolute | ( | const char * | path | ) |
std::string platform::LogWithSource | ( | const char * | file, |
int | line, | ||
const char * | fmt, | ||
... | |||
) |
yconstexpr platform::PDefH | ( | char | , |
MapKeyChar | , | ||
KeyIndex | |||
) |
映射按键到键入的字符。
|
inline |
判断指定字符串为文件名的文件是否存在。
当第一参数非空时取当前工作目录( UCS-2 编码)复制至指定缓冲区中。
buf | 缓冲区起始指针。 |
size | 缓冲区长。 |
yconstfn platform::RGBA | ( | typename Trait::BType | r, |
typename Trait::GType | g, | ||
typename Trait::RType | b, | ||
typename Trait::AType | a | ||
) |
void platform::StartTicks | ( | ) |
开始 tick 计时。
参考 YB_UNLIKELY , 以及 yunseq.
参考自 GetHighResolutionTicks() , 以及 GetTicks().
void platform::terminate | ( | ) |
异常终止函数。
在文件 ycommon.cpp 第 39 行定义.
参考自 YSLib::HandleFatalError(), YSLib::InitializeEnviornment() , 以及 ShowFatalError().
bool platform::truncate | ( | std::FILE * | fp, |
std::size_t | size | ||
) |
截断文件至指定长度。
若文件不足指定长度,扩展并使用空字节填充;否则保留起始指定长度的字节。
在文件 YCLib/FileSystem.cpp 第 426 行定义.
参考 CHRLib::fp.
char16_t* platform::u16getcwd_n | ( | char16_t * | buf, |
std::size_t | size | ||
) |
在文件 YCLib/FileSystem.cpp 第 335 行定义.
参考 CHRLib::MBCSToUCS2() , 以及 YB_LIKELY.
参考自 YSLib::IO::FetchCurrentWorkingDirectory().
bool platform::uchdir | ( | const char * | path | ) |
bool platform::ufexists | ( | const char * | filename | ) |
判断指定 UTF-8 文件名的文件是否存在。
在文件 YCLib/FileSystem.cpp 第 307 行定义.
参考 ystdex::fexists(), ufopen() , 以及 yconstraint.
参考自 YSLib::IO::ClassifyNode(), YSLib::LoadNPLA1File() , 以及 YSLib::Drawing::FontCache::LoadTypefaces().
bool platform::ufexists | ( | const char16_t * | filename | ) |
判断指定 UCS-2 文件名的文件是否存在。
在文件 YCLib/FileSystem.cpp 第 322 行定义.
参考 ufopen() , 以及 yconstraint.
std::FILE * platform::ufopen | ( | const char * | filename, |
const char * | mode | ||
) |
以 UTF-8 文件名打开文件。
filename | 文件名,意义同 std::fopen 。 |
mode | 打开模式,基本语义同 ISO C99 ,具体行为取决于实现。 |
filename && mode && *mode != 0
。 在文件 YCLib/FileSystem.cpp 第 269 行定义.
参考 yconstraint.
参考自 YSLib::File::Open() , 以及 ufexists().
std::FILE * platform::ufopen | ( | const char16_t * | filename, |
const char16_t * | mode | ||
) |
以 UCS-2 文件名打开文件。
filename | 文件名,意义同 std::fopen 。 |
mode | 打开模式,基本语义同 ISO C99 ,具体行为取决于实现。 |
filename && mode && *mode != 0
。 在文件 YCLib/FileSystem.cpp 第 287 行定义.
参考 CHRLib::strdup() , 以及 yconstraint.
bool platform::umkdir | ( | const char * | path | ) |
按 UTF-8 路径以默认权限新建一个目录。
在文件 YCLib/FileSystem.cpp 第 407 行定义.
参考自 YSLib::IO::EnsureDirectory().
int platform::uopen | ( | const char * | filename, |
int | oflag | ||
) |
以 UTF-8 文件名无缓冲打开文件。
filename | 文件名,意义同 POSIX ::open 。 |
oflag | 打开标识,基本语义同 POSIX 2003 ,具体行为取决于实现。 |
filename
。 在文件 YCLib/FileSystem.cpp 第 204 行定义.
参考 yconstraint.
int platform::uopen | ( | const char * | filename, |
int | oflag, | ||
int | pmode | ||
) |
以 UTF-8 文件名无缓冲打开文件。
filename | 文件名,意义同 POSIX ::open 。 |
oflag | 打开标识,基本语义同 POSIX 2003 ,具体行为取决于实现。 |
pmode | 打开模式,基本语义同 POSIX 2003 ,具体行为取决于实现。 |
filename
。 在文件 YCLib/FileSystem.cpp 第 220 行定义.
参考 yconstraint.
int platform::uopen | ( | const char16_t * | filename, |
int | oflag | ||
) |
以 UCS-2 文件名无缓冲打开文件。
filename | 文件名,意义同 POSIX ::open 。 |
oflag | 打开标识,基本语义同 POSIX 2003 ,具体行为取决于实现。 |
filename
。 在文件 YCLib/FileSystem.cpp 第 236 行定义.
参考 CHRLib::strdup() , 以及 yconstraint.
int platform::uopen | ( | const char16_t * | filename, |
int | oflag, | ||
int | pmode | ||
) |
以 UCS-2 文件名无缓冲打开文件。
filename | 文件名,意义同 POSIX ::open 。 |
oflag | 打开标识,基本语义同 POSIX 2003 ,具体行为取决于实现。 |
pmode | 打开模式,基本语义同 POSIX 2003 ,具体行为取决于实现。 |
filename
。 在文件 YCLib/FileSystem.cpp 第 252 行定义.
参考 CHRLib::strdup() , 以及 yconstraint.
bool platform::uremove | ( | const char * | path | ) |
bool platform::urmdir | ( | const char * | path | ) |
bool platform::uunlink | ( | const char * | path | ) |
void platform::WaitForInput | ( | ) |
等待任意按键。
参考 platform_ex::FetchKeyDownState() , 以及 platform_ex::UpdateKeyStates().
参考自 YSLib::UI::Console::Pause(), YDebug() , 以及 yprintf().
union platform::YB_ATTR | ( | packed | ) |
BGRA 四元组。
RGBA 四元组。
YF_API void platform::YConsoleInit | ( | std::uint8_t | dspIndex, |
Color | fc = ColorSpace::White , |
||
Color | bc = ColorSpace::Black |
||
) |
启动控制台。
参考自 YSLib::InitializeEnviornment() , 以及 YDebugBegin().
if (p == MAP_FAILED) throw std platform::addr = static_cast<ystdex::byte*>(p) |
在文件 MemoryMapping.cpp 第 97 行定义.
union _vA ::IntegerType platform::BGRA |
platform::fd |
在文件 MemoryMapping.cpp 第 82 行定义.
yconstexpr platform::MapKeyChar |
union _vA ::IntegerType platform::RGBA |
std::size_t size platform::ynothrow |
在文件 YCLib/FileSystem.h 第 256 行定义.
参考自 ImplRet().