MCPcopy Create free account
hub / github.com/FastLED/FastLED / substr

Method substr

src/fl/stl/string.cpp.hpp:161–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161string string::substr(fl::size start, fl::size length) const FL_NOEXCEPT {
162 // Handle `npos` / overflow: when `length == npos` the caller
163 // means "to end of string", and when `length` is large enough
164 // that `start + length` would wrap, we clamp to the end before
165 // the addition can overflow.
166 fl::size end;
167 if (length == npos || length > size() - (start < size() ? start : size())) {
168 end = size();
169 } else {
170 end = start + length;
171 if (end > size()) end = size();
172 }
173 return substring(start, end);
174}
175
176string string::substr(fl::size start) const FL_NOEXCEPT {
177 return substring(start, size());

Callers 15

parseHexColorFunction · 0.45
parseSegmentFieldsFunction · 0.45
formatSummaryTableFunction · 0.45
parseChunkSizeMethod · 0.45
urlClass · 0.45
parse_lnkFunction · 0.45
parse_lnk_with_metadataFunction · 0.45
trimFunction · 0.45
splitFunction · 0.45
parse_query_stringFunction · 0.45
read_requestMethod · 0.45

Calls 1

sizeFunction · 0.70

Tested by 7

mainFunction · 0.36
mainFunction · 0.36
mainFunction · 0.36
parse_argsFunction · 0.36
test_ping_endpointFunction · 0.36
test_promise_approachFunction · 0.36
test_await_approachFunction · 0.36