MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / convert

Function convert

extlibs/sol3/include/sol/sol.hpp:11674–11695  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11672
11673 template <typename Ch, typename F>
11674 inline void convert(const char* strb, const char* stre, F&& f) {
11675 char32_t cp = 0;
11676 for (const char* strtarget = strb; strtarget < stre;) {
11677 auto dr = unicode::utf8_to_code_point(strtarget, stre);
11678 if (dr.error != unicode::error_code::ok) {
11679 cp = unicode::unicode_detail::replacement;
11680 ++strtarget;
11681 }
11682 else {
11683 cp = dr.codepoint;
11684 strtarget = dr.next;
11685 }
11686 if constexpr (std::is_same_v<Ch, char32_t>) {
11687 auto er = unicode::code_point_to_utf32(cp);
11688 f(er);
11689 }
11690 else {
11691 auto er = unicode::code_point_to_utf16(cp);
11692 f(er);
11693 }
11694 }
11695 }
11696
11697 template <typename BaseCh, typename S>
11698 inline S get_into(lua_State* L, int index, record& tracking) {

Callers 1

utf16_to_utf8Method · 0.50

Calls 3

utf8_to_code_pointFunction · 0.85
code_point_to_utf32Function · 0.85
code_point_to_utf16Function · 0.85

Tested by

no test coverage detected