diff options
author | lado <herrlado@gmail.com> | 2012-01-23 17:24:13 +0100 |
---|---|---|
committer | lado <herrlado@gmail.com> | 2012-01-23 17:24:13 +0100 |
commit | 1b312e99919b33620f61140939361dbafee4e10f (patch) | |
tree | 449286acc4af913ad60518f2ce4eebd218ec9706 | |
parent | 9f1e0e1ffb445d93f316c53da9b24f8e8bfac509 (diff) | |
download | vdr-manager-1b312e99919b33620f61140939361dbafee4e10f.tar.gz vdr-manager-1b312e99919b33620f61140939361dbafee4e10f.tar.bz2 |
esacpe also channel name and id
-rw-r--r-- | vdr-vdrmanager/helpers.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/vdr-vdrmanager/helpers.cpp b/vdr-vdrmanager/helpers.cpp index 284c8a4..3f4b9ec 100644 --- a/vdr-vdrmanager/helpers.cpp +++ b/vdr-vdrmanager/helpers.cpp @@ -91,7 +91,7 @@ string cHelpers::GetTimersIntern() { string cHelpers::GetRecordingsIntern() { string result = "START\r\n"; - // iterate through all recordings + //iterate through all recordings cRecording* recording = NULL; for (int i = 0; i < Recordings.Count(); i++) { recording = Recordings.Get(i); @@ -473,7 +473,7 @@ string cHelpers::ToText(cRecording * recording) { result += ":"; if (info->ChannelName()) { - result += info->ChannelName(); + result += MapSpecialChars(info->ChannelName()); } else { result += "<unknown>"; } @@ -501,7 +501,7 @@ string cHelpers::ToText(cRecording * recording) { result += buf; result += ":"; - result += info->ChannelID().ToString(); + result += MapSpecialChars(info->ChannelID().ToString()); result += ":"; snprintf(buf, sizeof(buf)-1, "%d", RecordingLengthInSeconds(recording)); @@ -544,7 +544,7 @@ string cHelpers::ToText(cTimer * timer) { snprintf(buf, sizeof(buf)-1, "%d", timer->Channel()->Number()); result += buf; result += ":"; - result += channelName; + result += MapSpecialChars(channelName); result += ":"; snprintf(buf, sizeof(buf)-1, "%lu", timer->StartTime()); result += buf; @@ -573,7 +573,7 @@ string cHelpers::ToText(cTimer * timer) { result += "::"; } result += ":"; - result += timer->Channel()->GetChannelID().ToString(); + result += MapSpecialChars(timer->Channel()->GetChannelID().ToString()); result += "\r\n"; @@ -600,7 +600,7 @@ string cHelpers::ToText(const cEvent * event) { snprintf(buf, sizeof(buf)-1, "E%d", channel->Number()); result = buf; result += ":"; - result += channel->Name(); + result += MapSpecialChars(channel->Name()); result += ":"; snprintf(buf, sizeof(buf)-1, "%lu", event->StartTime()); result += buf; @@ -614,7 +614,7 @@ string cHelpers::ToText(const cEvent * event) { result += ":"; result += MapSpecialChars(event->ShortText() ? event->ShortText() : ""); result += ":"; - result += channel->GetChannelID().ToString(); + result += MapSpecialChars(channel->GetChannelID().ToString()); result += "\r\n"; if (eventTimer) { @@ -763,10 +763,18 @@ string cHelpers::SafeCall(string(*f)(string arg1, string arg2), string arg1, return ""; } +string cHelpers::MapSpecialChars(cString text) { -string cHelpers::MapSpecialChars(string text) { + return MapSpecialChars((const char *)text); +} + +string cHelpers::MapSpecialChars(const string text) { + return MapSpecialChars(text.c_str()); +} + +string cHelpers::MapSpecialChars(const char * p) { - const char * p = text.c_str(); + //const char * p = text.c_str(); string result = ""; while (*p) { switch (*p) { |