FastLED 3.9.15
Loading...
Searching...
No Matches

◆ operator()() [3/10]

template<typename T>
void fl::detail::JsonToIntegerVisitor< T >::operator() ( const fl::string & str)
inline

Definition at line 57 of file json_visitors.h.

57 {
58 char* end = nullptr;
59 long parsed = fl::strtol(str.c_str(), &end, 10);
60 if (end != str.c_str() && *end == '\0') {
61 mValue = static_cast<T>(parsed);
62 mResult.addWarning("string '" + str + "' parsed to int " + fl::to_string(static_cast<i64>(mValue)));
63 } else {
64 mResult.setError("cannot parse string '" + str + "' as integer");
65 }
66 }
long strtol(const char *str, char **endptr, int base)

References fl::basic_string::c_str(), fl::end(), mResult, mValue, fl::strtol(), and fl::to_string().

+ Here is the call graph for this function: