From 3c3887bb198c07b50ad3451f228aadfe6fd25168 Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Thu, 11 Dec 2014 17:58:50 -0500 Subject: Deduplicate code and use stdlib in string functions --- src/util/string.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/util/string.cpp') diff --git a/src/util/string.cpp b/src/util/string.cpp index c590e7e57..1d9560608 100644 --- a/src/util/string.cpp +++ b/src/util/string.cpp @@ -22,15 +22,16 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "numeric.h" #include "log.h" -#include -#include -#include - #include "../sha1.h" #include "../base64.h" #include "../hex.h" #include "../porting.h" +#include +#include +#include +#include + static bool parseHexColorString(const std::string &value, video::SColor &color); static bool parseNamedColorString(const std::string &value, video::SColor &color); @@ -577,3 +578,9 @@ static bool parseNamedColorString(const std::string &value, video::SColor &color return true; } + +void str_replace(std::string &str, char from, char to) +{ + std::replace(str.begin(), str.end(), from, to); +} + -- cgit v1.2.3