MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / replace_all

Function replace_all

app/workflow/workflow.cpp:114–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112 if (text == "false") {
113 return false;
114 }
115 }
116 throw std::runtime_error("workflow field must be a bool: " + key);
117}
118
119std::string replace_all(std::string text, const std::string & from, const std::string & to) {
120 if (from.empty()) {
121 return text;
122 }
123 size_t pos = 0;
124 while ((pos = text.find(from, pos)) != std::string::npos) {
125 text.replace(pos, from.size(), to);
126 pos += to.size();
127 }

Callers 1

expand_valueFunction · 0.70

Calls 3

emptyMethod · 0.45
findMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected