载入中...
搜索中...
未找到
utf8.h
浏览该文件的文档.
1#include "common/Export.h"
2
3
4#include "common/config.h"
5
6#include <cstddef>
7#include <string>
8
9#ifdef EVENGINE_WINDOWS
10#define NOMINMAX
11#include <windows.h>
12#endif
13
14namespace eve
15{
16
21EVENGINE_API_FOUNDATION size_t utf8_codepoint_count(const std::string &s);
22
27EVENGINE_API_FOUNDATION size_t utf8_byte_offset_for_codepoints(const std::string &s, size_t codepoints);
28
29#ifdef EVENGINE_WINDOWS
30
36std::string to_utf8(LPCWSTR wstr);
37
43std::wstring to_widestr(const std::string &str);
44
51void replace_char(std::string &str, char find, char replace);
52
53#endif // EVENGINE_WINDOWS
54
55} // eve
const std::string & s
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition Export.h:106
Build metadata (engine git commit, build time, third-party version).
Definition Build.cpp:16
size_t utf8_codepoint_count(const std::string &s)
Count UTF-8 code points in a string. Invalid / truncated sequences stop the scan.
Definition utf8.cpp:23
size_t utf8_byte_offset_for_codepoints(const std::string &s, size_t codepoints)
Byte offset of the N-th UTF-8 code point (0-based count of code points). Returns s....
Definition utf8.cpp:37