MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenColorIO / StringToFloat

Function StringToFloat

src/OpenColorIO/ParseUtils.cpp:575–588  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

573}
574
575bool StringToFloat(float * fval, const char * str)
576{
577 if(!str) return false;
578
579 float x = NAN;
580 const auto result = NumberUtils::from_chars(str, str + strlen(str), x);
581 if (result.ec != std::errc())
582 {
583 return false;
584 }
585
586 if(fval) *fval = x;
587 return true;
588}
589
590bool StringToInt(int * ival, const char * str, bool failIfLeftoverChars)
591{

Callers 2

readMethod · 0.50
readMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected