diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2009-03-31 15:51:31 +0200 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2009-03-31 15:51:31 +0200 |
| commit | bce53d4a67d1655a496eebe5912c8573e880114e (patch) | |
| tree | 9b410fbcaf0f4a22f1cf3489b635e3e94e47a6d8 /lib/base/estring.cpp | |
| parent | 166db5a9c9222c82939eede51d964c706039ebe8 (diff) | |
| parent | 54475ce18e43482b2ec1a150f7fa07c3464ec6d2 (diff) | |
| download | enigma2-bce53d4a67d1655a496eebe5912c8573e880114e.tar.gz enigma2-bce53d4a67d1655a496eebe5912c8573e880114e.zip | |
Merge commit 'origin/master' into tmbinc/FixTimingBugs
Diffstat (limited to 'lib/base/estring.cpp')
| -rw-r--r-- | lib/base/estring.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/base/estring.cpp b/lib/base/estring.cpp index 5d15ddce..dcba7705 100644 --- a/lib/base/estring.cpp +++ b/lib/base/estring.cpp @@ -1,6 +1,7 @@ +#include <algorithm> +#include <cctype> +#include <climits> #include <string> -#include <ctype.h> -#include <limits.h> #include <lib/base/eerror.h> #include <lib/base/encoding.h> #include <lib/base/estring.h> @@ -633,3 +634,12 @@ void makeUpper(std::string &s) { std::transform(s.begin(), s.end(), s.begin(), (int(*)(int)) toupper); } + +std::string replace_all(const std::string &in, const std::string &entity, const std::string &symbol) +{ + std::string out = in; + std::string::size_type loc = 0; + while (( loc = out.find(entity, loc)) != std::string::npos ) + out.replace(loc, entity.length(), symbol); + return out; +} |
