MCPcopy Create free account
hub / github.com/colmap/colmap / StringReplace

Function StringReplace

src/colmap/util/string.cc:222–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220}
221
222std::string StringReplace(const std::string& str,
223 const std::string& old_str,
224 const std::string& new_str) {
225 if (old_str.empty()) {
226 return str;
227 }
228 size_t position = 0;
229 std::string mod_str = str;
230 while ((position = mod_str.find(old_str, position)) != std::string::npos) {
231 mod_str.replace(position, old_str.size(), new_str);
232 position += new_str.size();
233 }
234 return mod_str;
235}
236
237std::string StringGetAfter(const std::string& str, const std::string& key) {
238 if (key.empty()) {

Callers 4

RectifyMethod · 0.85
QuerySensorWidthMethod · 0.85
TESTFunction · 0.85
NormalizePathFunction · 0.85

Calls 2

emptyMethod · 0.80
sizeMethod · 0.80

Tested by 1

TESTFunction · 0.68