diff options
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 |