VS2012.
This commit is contained in:
Kim Kulling
2016-06-20 20:30:29 +02:00
parent 447a9642c2
commit 9b6de15b74
4 changed files with 90 additions and 3 deletions
+17
View File
@@ -89,5 +89,22 @@ std::string to_string( T value ) {
return os.str();
}
inline
float ai_strtof( const char *begin, const char *end ) {
if ( nullptr == begin ) {
return 0.0f;
}
float val( 0.0f );
if ( nullptr == end ) {
val = static_cast< float >( ::atof( begin ) );
} else {
std::string::size_type len( end - begin );
std::string token( begin, len );
val = static_cast< float >( ::atof( token.c_str() ) );
}
return val;
}
#endif // INCLUDED_AI_STRINGUTILS_H