summaryrefslogtreecommitdiff
path: root/tools.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools.cpp')
-rw-r--r--tools.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools.cpp b/tools.cpp
index 5fee00b..8b6006e 100644
--- a/tools.cpp
+++ b/tools.cpp
@@ -293,5 +293,23 @@ namespace vdrlive {
return FormatDateTime(cformat.c_str(), date);
}
+ std::string EncodeDomId(std::string const & toEncode, char const * from, char const * to)
+ {
+ std::string encoded = toEncode;
+ for (; *from && *to; from++, to++) {
+ replace(encoded.begin(), encoded.end(), *from, *to);
+ }
+ return encoded;
+ }
+
+ std::string DecodeDomId(std::string const & toDecode, char const * from, char const * to)
+ {
+ std::string decoded = toDecode;
+ for (; *from && *to; from++, to++) {
+ replace(decoded.begin(), decoded.end(), *from, *to);
+ }
+ return decoded;
+ }
+
} // namespace vdrlive