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

◆ operator()() [3/10]

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

Definition at line 210 of file json_visitors.h.

210 {
211 char* end = nullptr;
212 double parsed = fl::strtod(str.c_str(), &end);
213 if (end != str.c_str() && *end == '\0') {
214 mValue = static_cast<T>(parsed);
215 // Warning string uses float precision (see #3002).
216 mResult.addWarning("string '" + str + "' parsed to float " + fl::to_string(static_cast<float>(mValue), 6));
217 } else {
218 mResult.setError("cannot parse string '" + str + "' as float");
219 }
220 }
double strtod(const char *str, char **endptr)
TypeConversionResult mResult

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

+ Here is the call graph for this function: