From a0f950a57be97a09ff1ea8a1339232379d37574c Mon Sep 17 00:00:00 2001 From: Sascha Volkenandt Date: Thu, 18 Jan 2007 20:20:20 +0000 Subject: - added function StringEscapeAndBreak, which *first* html-escapes a string and *second* replaces \n by
- using StringEscapeAndBreak for description in whats_on --- tools.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tools.cpp') diff --git a/tools.cpp b/tools.cpp index 2382d8f..9445c93 100644 --- a/tools.cpp +++ b/tools.cpp @@ -1,13 +1,15 @@ #include +#include +#include #include #include -#include #include "exception.h" #include "live.h" #include "setup.h" #include "tools.h" using namespace std; +using namespace tnt; istream& operator>>( istream& is, tChannelID& ret ) { @@ -93,4 +95,12 @@ string StringWordTruncate(const string& input, size_t maxLen, bool& truncated) return result.substr(0, pos); } +string StringEscapeAndBreak( string const& input ) +{ + stringstream plainBuilder; + HtmlEscOstream builder( plainBuilder ); + builder << input; + return StringReplace( plainBuilder.str(), "\n", "
" ); +} + } // namespace vdrlive -- cgit v1.2.3