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

Function StringToFloat

src/apps/ocioconvert/main.cpp:706–725  ·  view source on GitHub ↗

return true on success.

Source from the content-addressed store, hash-verified

704
705// return true on success.
706bool StringToFloat(float * fval, const char * str)
707{
708 if (!str)
709 {
710 return false;
711 }
712
713 std::istringstream inputStringstream(str);
714 float x;
715 if (!(inputStringstream >> x))
716 {
717 return false;
718 }
719
720 if (fval)
721 {
722 *fval = x;
723 }
724 return true;
725}
726
727bool StringToInt(int * ival, const char * str)
728{

Callers 2

mainFunction · 0.70
OCIO_ADD_TESTFunction · 0.50

Calls

no outgoing calls

Tested by 1

OCIO_ADD_TESTFunction · 0.40