| 25 | #include "pattern.h" |
| 26 | |
| 27 | static void |
| 28 | replaceString(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 | |
| 41 | Pattern::Pattern() : _pattern(""), _replacement("") {} |
| 42 |