diff options
Diffstat (limited to 'tools.cpp')
-rw-r--r-- | tools.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -49,4 +49,13 @@ vector< string > StringSplit( string const& text, char delimiter ) return result; } +int StringToInt( std::string const& string, int base ) +{ + char* end; + int result = strtol( string.c_str(), &end, base ); + if ( *end == '\0' ) + return result; + return 0; +} + } |