diff options
author | Sascha Volkenandt <sascha (at) akv-soft (dot) de> | 2007-01-12 22:05:30 +0000 |
---|---|---|
committer | Sascha Volkenandt <sascha (at) akv-soft (dot) de> | 2007-01-12 22:05:30 +0000 |
commit | 2cb8c257e0693fe8c7c7bdfe2b2dbe5c6b156bbe (patch) | |
tree | f725782ef5c1a47fbf15d705fade594bc6ef0aa0 /tools.cpp | |
parent | b405e4e3d31ceda6fa3de366d8c5374a160e1266 (diff) | |
download | vdr-plugin-live-2cb8c257e0693fe8c7c7bdfe2b2dbe5c6b156bbe.tar.gz vdr-plugin-live-2cb8c257e0693fe8c7c7bdfe2b2dbe5c6b156bbe.tar.bz2 |
- added operators for streaming tChannelID
- passing tChannelID consistently
Diffstat (limited to 'tools.cpp')
-rw-r--r-- | tools.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -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; |