diff options
| author | Sascha Volkenandt <sascha (at) akv-soft (dot) de> | 2007-01-18 20:20:20 +0000 |
|---|---|---|
| committer | Sascha Volkenandt <sascha (at) akv-soft (dot) de> | 2007-01-18 20:20:20 +0000 |
| commit | a0f950a57be97a09ff1ea8a1339232379d37574c (patch) | |
| tree | f1783d6d83356d348c07ab6159a2919acfd42e21 /tools.cpp | |
| parent | 974eeee2b59084e53fb24b36ca9ea83922bb8f77 (diff) | |
| download | vdr-plugin-live-a0f950a57be97a09ff1ea8a1339232379d37574c.tar.gz vdr-plugin-live-a0f950a57be97a09ff1ea8a1339232379d37574c.tar.bz2 | |
- added function StringEscapeAndBreak, which *first* html-escapes a string and *second* replaces \n by <br/>
- using StringEscapeAndBreak for description in whats_on
Diffstat (limited to 'tools.cpp')
| -rw-r--r-- | tools.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -1,13 +1,15 @@ #include <stdexcept> +#include <tnt/ecpp.h> +#include <tnt/htmlescostream.h> #include <tnt/httprequest.h> #include <tnt/httpreply.h> -#include <tnt/ecpp.h> #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", "<br/>" ); +} + } // namespace vdrlive |
