MCPcopy Create free account
hub / github.com/KDE/labplot / next

Method next

src/3rdparty/stringtokenizer/qstringtokenizer.h:486–514  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

484
485template<typename Haystack, typename Needle>
486auto QStringTokenizerBase<Haystack, Needle>::next(tokenizer_state state) const noexcept -> next_result
487{
488 while (true)
489 {
490 if (state.end < 0)
491 {
492 // already at end:
493 return {{}, false, state};
494 }
495 state.end = m_haystack.indexOf(m_needle, state.start + state.extra, m_cs);
496 Haystack result;
497 if (state.end >= 0)
498 {
499 // token separator found => return intermediate element:
500 result = m_haystack.mid(state.start, state.end - state.start);
501 const auto ns = KDToolBoxPrivate::Tok::size(m_needle);
502 state.start = state.end + ns;
503 state.extra = (ns == 0 ? 1 : 0);
504 }
505 else
506 {
507 // token separator not found => return final element:
508 result = m_haystack.mid(state.start);
509 }
510 if ((m_sb & Qt::SkipEmptyParts) && result.isEmpty())
511 continue;
512 return {result, true, state};
513 }
514}
515
516#endif /* QSTRINGTOKENIZER_H */

Callers 15

saveToXmlFileMethod · 0.80
mergeFormatMethod · 0.80
formatKeyMethod · 0.80
copyMethod · 0.80
saveToXmlFileMethod · 0.80
saveXmlHyperlinksMethod · 0.80
splitColsInfoMethod · 0.80
getFullCellsMethod · 0.80
writeNumFmtsMethod · 0.80
advanceMethod · 0.80
setAreaWidgetsMethod · 0.80
cursorLocationMethod · 0.80

Calls 3

sizeFunction · 0.85
indexOfMethod · 0.45
isEmptyMethod · 0.45

Tested by 1