MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / split_ints

Method split_ints

modules/gui/gui/src/backend/text_server/ustring.cpp:1595–1622  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1593}
1594
1595Vector<int> String::split_ints(const String& p_splitter, bool p_allow_empty) const
1596{
1597 Vector<int> ret;
1598 int from = 0;
1599 int len = length();
1600
1601 while (true)
1602 {
1603 int end = find(p_splitter, from);
1604 if (end < 0)
1605 {
1606 end = len;
1607 }
1608 if (p_allow_empty || (end > from))
1609 {
1610 ret.push_back(String::to_int(&get_data()[from], end - from));
1611 }
1612
1613 if (end == len)
1614 {
1615 break;
1616 }
1617
1618 from = end + p_splitter.length();
1619 }
1620
1621 return ret;
1622}
1623
1624Vector<int> String::split_ints_mk(const Vector<String>& p_splitters, bool p_allow_empty) const
1625{

Callers

nothing calls this directly

Calls 5

lengthFunction · 0.50
findFunction · 0.50
get_dataFunction · 0.50
push_backMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected