MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / forEachSplitView

Method forEachSplitView

source/core/StarStringView.cpp:148–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148void StringView::forEachSplitView(StringView pattern, SplitCallback callback) const {
149 if (pattern.empty())
150 return;
151
152 size_t beg = 0;
153 while (true) {
154 size_t end = m_view.find(pattern.m_view, beg);
155 if (end == NPos) {
156 callback(m_view.substr(beg), beg, m_view.size() - beg);
157 break;
158 }
159 callback(m_view.substr(beg, end - beg), beg, end - beg);
160 beg = end + pattern.m_view.size();
161 }
162}
163
164bool StringView::hasChar(Char c) const {
165 for (Char ch : *this)

Callers 5

parseImageOperationsFunction · 0.80
parseMethod · 0.80
stringWidthMethod · 0.80
processWrapTextMethod · 0.80
applyCommandsMethod · 0.80

Calls 4

emptyMethod · 0.45
findMethod · 0.45
substrMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected