mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-05-16 14:14:07 +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 "]"
|
#define GET(array, index) array "[" index "]"
|
||||||
#endif
|
#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<void(string&, string&)> hooks_rayshader;
|
||||||
EX hookset<bool(shared_ptr<raycaster>)> hooks_rayset;
|
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--; }
|
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
|
#if CAP_ZLIB
|
||||||
/* compression/decompression */
|
/* compression/decompression */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user