From: <axl...@us...> - 2008-12-04 01:50:03
|
Revision: 34 http://hgengine.svn.sourceforge.net/hgengine/?rev=34&view=rev Author: axlecrusher Date: 2008-12-04 01:48:14 +0000 (Thu, 04 Dec 2008) Log Message: ----------- add string to float function Modified Paths: -------------- Mercury2/src/MercuryUtil.cpp Mercury2/src/MercuryUtil.h Modified: Mercury2/src/MercuryUtil.cpp =================================================================== --- Mercury2/src/MercuryUtil.cpp 2008-12-04 01:46:14 UTC (rev 33) +++ Mercury2/src/MercuryUtil.cpp 2008-12-04 01:48:14 UTC (rev 34) @@ -10,6 +10,13 @@ return t; } +float StrToFloat(const std::string& s) +{ + float x; + sscanf(s.c_str(), "%f", &x); + return x; +} + /*************************************************************************** * Copyright (C) 2008 by Joshua Allen * * * Modified: Mercury2/src/MercuryUtil.h =================================================================== --- Mercury2/src/MercuryUtil.h 2008-12-04 01:46:14 UTC (rev 33) +++ Mercury2/src/MercuryUtil.h 2008-12-04 01:48:14 UTC (rev 34) @@ -18,6 +18,8 @@ std::string ToUpper(const std::string& s); +float StrToFloat(const std::string& s); + //This counter is used with singletons to //ensure proper destruction order of the //singleton This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |