mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Deduplicate code and use stdlib in string functions
This commit is contained in:
parent
d91559b8f0
commit
3c3887bb19
4 changed files with 168 additions and 218 deletions
|
@ -22,15 +22,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "numeric.h"
|
||||
#include "log.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <map>
|
||||
|
||||
#include "../sha1.h"
|
||||
#include "../base64.h"
|
||||
#include "../hex.h"
|
||||
#include "../porting.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <map>
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue