MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / _hx_utf8_iter

Function _hx_utf8_iter

src/String.cpp:647–666  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

645
646
647void _hx_utf8_iter(String inString, Dynamic inIter)
648{
649 #ifdef HX_SMART_STRINGS
650 if (inString.isUTF16Encoded())
651 for(int i=0;i<inString.length;i++)
652 inIter( (int)inString.raw_wptr()[i] );
653 else
654 for(int i=0;i<inString.length;i++)
655 inIter( (int)inString.raw_ptr()[i] );
656 #else
657 const unsigned char *src = (const unsigned char *)inString.__s;
658 const unsigned char *end = src + inString.length;
659
660 while(src<end)
661 inIter(DecodeAdvanceUTF8(src,end+1));
662
663 if (src>end)
664 hx::Throw(HX_CSTRING("Invalid UTF8"));
665 #endif
666}
667
668int _hx_utf8_char_code_at(String inString, int inIndex)
669{

Callers

nothing calls this directly

Calls 2

DecodeAdvanceUTF8Function · 0.85
ThrowFunction · 0.85

Tested by

no test coverage detected