MCPcopy Create free account
hub / github.com/apache/trafficserver / replaceString

Function replaceString

plugins/prefetch/pattern.cc:27–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25#include "pattern.h"
26
27static void
28replaceString(String &str, const String &from, const String &to)
29{
30 if (from.empty()) {
31 return;
32 }
33
34 String::size_type start_pos = 0;
35 while ((start_pos = str.find(from, start_pos)) != String::npos) {
36 str.replace(start_pos, from.length(), to);
37 start_pos += to.length();
38 }
39}
40
41Pattern::Pattern() : _pattern(""), _replacement("") {}
42

Callers 1

initMethod · 0.70

Calls 4

emptyMethod · 0.45
findMethod · 0.45
replaceMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected