MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / GetByteMap

Function GetByteMap

src/UTF8Util.hpp:355–365  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

353 }
354
355 static void GetByteMap(const char* str, const size_t utf8Length,
356 std::vector<size_t>* byteMap) {
357 if (byteMap->size() < utf8Length) {
358 byteMap->resize(utf8Length);
359 }
360 const char* pstr = str;
361 for (size_t i = 0; i < utf8Length; i++) {
362 (*byteMap)[i] = pstr - str;
363 pstr = NextChar(pstr);
364 }
365 }
366
367#ifdef _MSC_VER
368 static std::wstring GetPlatformString(const std::string& str) {

Callers 1

TEST_FFunction · 0.85

Calls 3

NextCharFunction · 0.85
sizeMethod · 0.45
resizeMethod · 0.45

Tested by 1

TEST_FFunction · 0.68