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

Function parseInt

src/fl/stl/asio/http/http_parser.cpp.hpp:41–54  ·  view source on GitHub ↗

Helper: Parse integer from string

Source from the content-addressed store, hash-verified

39
40// Helper: Parse integer from string
41bool parseInt(const fl::string& str, int& out) {
42 if (str.empty()) return false;
43
44 int value = 0;
45 for (size_t i = 0; i < str.size(); i++) {
46 if (!fl::isdigit(str[i])) {
47 return false;
48 }
49 value = value * 10 + (str[i] - '0');
50 }
51
52 out = value;
53 return true;
54}
55} // anonymous namespace
56
57//==============================================================================

Callers 4

feedMethod · 0.70
parseStatusLineMethod · 0.70
operator()Method · 0.50
operator()Method · 0.50

Calls 3

isdigitFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected