YSTest: NLS.h 源文件

YSTest PreAlpha_b900_20201012 The YSLib Test Project

NLS.h
浏览该文件的文档.
1 /*
2 © 2014-2016, 2018 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
29 #ifndef YCL_MinGW32_INC_NLS_h_
30 #define YCL_MinGW32_INC_NLS_h_ 1
31
32 #include "YCLib/YModules.h"
33 #include YFM_Win32_YCLib_MinGW32 // for string, CP_UTF8, CP_ACP, string_view,
34 // wstring, wstring_view;
35
36 namespace platform_ex
37 {
38
39 inline namespace Windows
40 {
41
50 YF_API YB_NONNULL(1) string
52 MBCSToMBCS(const char*, unsigned = CP_UTF8, unsigned = CP_ACP);
54 YF_API string
55 MBCSToMBCS(string_view, unsigned = CP_UTF8, unsigned = CP_ACP);
56
58 YF_API YB_NONNULL(1) wstring
59 MBCSToWCS(const char*, unsigned = CP_ACP);
61 YF_API wstring
62 MBCSToWCS(string_view, unsigned = CP_ACP);
63
65 YF_API YB_NONNULL(1) string
66 WCSToMBCS(const wchar_t*, unsigned = CP_ACP);
68 YF_API string
69 WCSToMBCS(wstring_view, unsigned = CP_ACP);
70
72 YB_NONNULL(1) inline PDefH(wstring, UTF8ToWCS, const char* str)
73 ImplRet(MBCSToWCS(str, CP_UTF8))
75 inline PDefH(wstring, UTF8ToWCS, string_view sv)
76 ImplRet(MBCSToWCS(sv, CP_UTF8))
77
79 YB_NONNULL(1) inline PDefH(string, WCSToUTF8, const wchar_t* str)
80 ImplRet(WCSToMBCS(str, CP_UTF8))
82 inline PDefH(string, WCSToUTF8, wstring_view sv)
83 ImplRet(WCSToMBCS(sv, CP_UTF8))
85
86
92 YF_API YB_NONNULL(1) wstring
93 FetchNLSItemFromRegistry(const wchar_t*);
94
99 inline PDefH(wstring, FetchCPFileNameFromRegistry, int cp)
100 ImplRet(FetchNLSItemFromRegistry(to_wstring(cp).c_str()))
101
108 YF_API const unsigned short*
109 FetchDBCSOffset(int) ynothrow;
110
111 } // inline namespace Windows;
112
113 } // namespace platform_ex;
114
115 #endif
116
platform_ex::Windows::PDefH
YB_ATTR_nodiscard YB_STATELESS yconstfn PDefH(bool, IsDirectory, FileAttributes attr) ynothrow ImplRet(attr &Directory) YB_ATTR_nodiscard YB_STATELESS inline PDefH(bool
判断 FileAttributes 是否指定目录。
ystdex::cpp2017::basic_string
Definition: string.hpp:77
platform_ex
平台扩展命名空间。
Definition: Android.h:46
ystdex::cpp2017::string_view
basic_string_view< char > string_view
Definition: string_view.hpp:437
ystdex::cpp2017::wstring_view
basic_string_view< wchar_t > wstring_view
Definition: string_view.hpp:440
YF_API
#define YF_API
Definition: Platform.h:56
platform_ex::Windows::WCSToUTF8
const char *str string_view sv WCSToUTF8
Definition: NLS.h:79
platform_ex::Windows::ImplRet
YB_ATTR_nodiscard YB_STATELESS yconstfnconst ::WIN32_FIND_DATAA &d ynothrow ImplRet(IsDirectory(FileAttributes(d.dwFileAttributes))) YB_ATTR_nodiscard YB_STATELESS inline PDefH(bool
判断 ::WIN32_FIND_DATAW 指定的节点是否为目录。
platform_ex::Windows::UTF8ToWCS
UTF8ToWCS
Definition: NLS.h:72
platform_ex::Windows::MBCSToMBCS
YF_API string MBCSToMBCS(string_view, unsigned=CP_UTF8, unsigned=CP_ACP)
ystdex::to_wstring
enable_if_t< is_arithmetic< _type >::value, wstring > to_wstring(_type val)
Definition: string.hpp:1880
platform_ex::Windows::WCSToMBCS
YF_API string WCSToMBCS(wstring_view, unsigned=CP_ACP)
platform_ex::Windows::MBCSToWCS
YF_API wstring MBCSToWCS(string_view, unsigned=CP_ACP)
platform_ex::Windows::YB_NONNULL
YF_API YB_ATTR_returns_nonnull YB_NONNULL(2) ModuleProc *LoadProc( YB_NONNULL(2) inline _func &LoadProc(
从模块加载指定过程的指针。
Definition: Win32/include/YCLib/MinGW32.h:246
YModules.h
YCLib 库模块配置文件。
NPL::c_str
YF_API const char src c_str())) YF_API void InstallDirectory(const string &
安装目录：复制目录树。
Definition: Dependency.h:140
YSLib::Text::str
YB_ATTR_nodiscard YB_PURE const char const char * str
Definition: TextFile.h:83
const
const Decapsulate const Decapsulate &y ynothrow ContextNode &ctx const
Definition: NPLA1Forms.cpp:1629
ystdex::cpp2017::string
basic_string< char > string
Definition: string.hpp:772
ynothrow
#define ynothrow
YSLib 无异常抛出保证：若支持 noexcept 关键字， 指定特定的 noexcept 异常规范。
Definition: ydef.h:1199