mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-23 13:07:16 +00:00
moved replace_str to util
This commit is contained in:
parent
a3574a2c13
commit
dc20dfe648
@ -215,11 +215,6 @@ string build_getter(string type, string name, int index) {
|
||||
#define GET(array, index) array "[" index "]"
|
||||
#endif
|
||||
|
||||
void replace_str(string& s, string a, string b) {
|
||||
while(s.find(a) != string::npos)
|
||||
s.replace(s.find(a), isize(a), b);
|
||||
}
|
||||
|
||||
EX hookset<void(string&, string&)> hooks_rayshader;
|
||||
EX hookset<bool(shared_ptr<raycaster>)> hooks_rayset;
|
||||
|
||||
|
6
util.cpp
6
util.cpp
@ -690,6 +690,12 @@ bignum::bignum(ld d) {
|
||||
while(n >= 0) { digits[n] = int(d); d -= digits[n]; d *= BASE; n--; }
|
||||
}
|
||||
|
||||
/** in s, replace occurences of a with b */
|
||||
EX void replace_str(string& s, string a, string b) {
|
||||
while(s.find(a) != string::npos)
|
||||
s.replace(s.find(a), isize(a), b);
|
||||
}
|
||||
|
||||
#if CAP_ZLIB
|
||||
/* compression/decompression */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user