| 338 | } |
| 339 | |
| 340 | void FindAndReplace(string &str, const string &find, const string &replace) { |
| 341 | if (find.empty()) return; |
| 342 | |
| 343 | size_t pos = 0; |
| 344 | |
| 345 | while ((pos = str.find(find, pos)) != string::npos) { |
| 346 | str.replace(pos, find.length(), replace); |
| 347 | pos += replace.length(); |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | // Note: better to sort queries automatically |
| 352 | // for more information refer to Amazon S3 document: |