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

Method split_floats

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

Source from the content-addressed store, hash-verified

1528}
1529
1530Vector<double> String::split_floats(const String& p_splitter, bool p_allow_empty) const
1531{
1532 Vector<double> ret;
1533 int from = 0;
1534 int len = length();
1535
1536 while (true)
1537 {
1538 int end = find(p_splitter, from);
1539 if (end < 0)
1540 {
1541 end = len;
1542 }
1543 if (p_allow_empty || (end > from))
1544 {
1545 ret.push_back(String::to_float(&get_data()[from]));
1546 }
1547
1548 if (end == len)
1549 {
1550 break;
1551 }
1552
1553 from = end + p_splitter.length();
1554 }
1555
1556 return ret;
1557}
1558
1559Vector<float> String::split_floats_mk(const Vector<String>& p_splitters, bool p_allow_empty) const
1560{

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected