summaryrefslogtreecommitdiff
path: root/tools.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools.cpp')
-rw-r--r--tools.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/tools.cpp b/tools.cpp
index 2382d8f..9445c93 100644
--- a/tools.cpp
+++ b/tools.cpp
@@ -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