From 2cb8c257e0693fe8c7c7bdfe2b2dbe5c6b156bbe Mon Sep 17 00:00:00 2001 From: Sascha Volkenandt Date: Fri, 12 Jan 2007 22:05:30 +0000 Subject: - added operators for streaming tChannelID - passing tChannelID consistently --- tools.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'tools.cpp') diff --git a/tools.cpp b/tools.cpp index da83aff..a6c8973 100644 --- a/tools.cpp +++ b/tools.cpp @@ -7,10 +7,21 @@ #include "setup.h" #include "tools.h" -namespace vdrlive { - using namespace std; +istream& operator>>( istream& is, tChannelID& ret ) +{ + if ( is.rdbuf()->in_avail() > 0 ) { + string line; + if ( !getline( is, line ) || ( !line.empty() && !( ret = tChannelID::FromString( line.c_str() ) ).Valid() ) ) + is.setstate( ios::badbit ); + cerr << "channel id " << line << endl << endl; + } + return is; +} + +namespace vdrlive { + string FormatDateTime( char const* format, time_t time ) { struct tm tm_r; -- cgit v1.2.3