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

Method forEachSplitAnyView

source/core/StarStringView.cpp:132–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132void StringView::forEachSplitAnyView(StringView chars, SplitCallback callback) const {
133 if (chars.empty())
134 return;
135
136 size_t beg = 0;
137 while (true) {
138 size_t end = m_view.find_first_of(chars.m_view, beg);
139 if (end == NPos) {
140 callback(m_view.substr(beg), beg, m_view.size() - beg);
141 break;
142 }
143 callback(m_view.substr(beg, end - beg), beg, end - beg);
144 beg = end + 1;
145 }
146}
147
148void StringView::forEachSplitView(StringView pattern, SplitCallback callback) const {
149 if (pattern.empty())

Callers 1

imageOperationFromStringFunction · 0.80

Calls 3

emptyMethod · 0.45
substrMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected