| 1247 | } |
| 1248 | |
| 1249 | Vector<float> String::split_floats_mk(const Vector<String> &p_splitters, bool p_allow_empty) const { |
| 1250 | Vector<float> ret; |
| 1251 | int from = 0; |
| 1252 | int len = length(); |
| 1253 | |
| 1254 | String buffer = *this; |
| 1255 | while (true) { |
| 1256 | int idx; |
| 1257 | int end = findmk(p_splitters, from, &idx); |
| 1258 | int spl_len = 1; |
| 1259 | if (end < 0) { |
| 1260 | end = len; |
| 1261 | } else { |
| 1262 | spl_len = p_splitters[idx].length(); |
| 1263 | } |
| 1264 | |
| 1265 | if (p_allow_empty || (end > from)) { |
| 1266 | buffer[end] = 0; |
| 1267 | ret.push_back(String::to_float(&buffer.get_data()[from])); |
| 1268 | buffer[end] = _cowdata.get(end); |
| 1269 | } |
| 1270 | |
| 1271 | if (end == len) { |
| 1272 | break; |
| 1273 | } |
| 1274 | |
| 1275 | from = end + spl_len; |
| 1276 | } |
| 1277 | |
| 1278 | return ret; |
| 1279 | } |
| 1280 | |
| 1281 | Vector<int> String::split_ints(const String &p_splitter, bool p_allow_empty) const { |
| 1282 | Vector<int> ret; |
no test coverage detected