MCPcopy Create free account
hub / github.com/MyGUI/mygui / find_last_of

Method find_last_of

MyGUIEngine/src/MyGUI_UString.cpp:1450–1473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1448 }
1449
1450 UString::size_type UString::find_last_of(const UString& str, size_type index /*= npos*/, size_type num /*= npos */)
1451 const
1452 {
1453 size_type i = 0;
1454 const size_type len = length();
1455 if (index > len)
1456 index = len - 1;
1457
1458 while (i < num && (index - i) != npos)
1459 {
1460 size_type j = index - i;
1461 // careful to step full Unicode characters
1462 if (j != 0 && _utf16_surrogate_follow(at(j)) && _utf16_surrogate_lead(at(j - 1)))
1463 {
1464 j = index - ++i;
1465 }
1466 // and back to the usual dull test
1467 unicode_char ch = getChar(j);
1468 if (str.inString(ch))
1469 return j;
1470 i++;
1471 }
1472 return npos;
1473 }
1474
1475 UString::size_type UString::find_last_of(code_point ch, size_type index /*= npos */) const
1476 {

Callers 11

getSystemFileListFunction · 0.80
startAppFunction · 0.80
upFolderMethod · 0.80
prepareMethod · 0.80
convertProjectNameMethod · 0.80
prepareMethod · 0.80
saveItemToProjectMethod · 0.80
upFolderMethod · 0.80
prepareMethod · 0.80
prepareMethod · 0.80

Calls 4

find_last_ofFunction · 0.85
UStringFunction · 0.85
inStringMethod · 0.80
lengthFunction · 0.50

Tested by

no test coverage detected