summaryrefslogtreecommitdiff
path: root/tools.cpp
diff options
context:
space:
mode:
authorChristian Wieninger <cwieninger (at) gmx (dot) de>2008-03-22 20:31:16 +0100
committerChristian Wieninger <cwieninger (at) gmx (dot) de>2008-03-22 20:31:16 +0100
commita69f5f5873c2843780b9779f5eccf6e2a692da80 (patch)
tree76db2ba8ec534414913ccb56ea2cea9600afdab0 /tools.cpp
parentc9732d7643b30e4414ce5e759019365e08a0ce10 (diff)
parentd00342a76f291e9a01548b90ebfe3334959ce7aa (diff)
downloadvdr-plugin-live-a69f5f5873c2843780b9779f5eccf6e2a692da80.tar.gz
vdr-plugin-live-a69f5f5873c2843780b9779f5eccf6e2a692da80.tar.bz2
Merge commit 'tadi/master'cvs-commit-348
Conflicts: tools.cpp
Diffstat (limited to 'tools.cpp')
-rw-r--r--tools.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools.cpp b/tools.cpp
index cca1b9d..8053c3d 100644
--- a/tools.cpp
+++ b/tools.cpp
@@ -17,6 +17,7 @@ using namespace tnt;
istream& operator>>( istream& is, tChannelID& ret )
{
+ /* alternativ implementation
string line;
if ( !getline( is, line ) ) {
if ( !is.eof() )
@@ -28,6 +29,23 @@ istream& operator>>( istream& is, tChannelID& ret )
if ( !line.empty() && !( ret = tChannelID::FromString( line.c_str() ) ).Valid() )
is.setstate( ios::badbit );
return is;
+ */
+
+ string line;
+ if (!getline( is, line ) ) {
+ if (0 == is.gcount()) {
+ is.clear(is.rdstate() & ~ios::failbit);
+ return is;
+ }
+ if (!is.eof()) {
+ is.setstate( ios::badbit );
+ return is;
+ }
+ }
+
+ if ( !line.empty() && !( ret = tChannelID::FromString( line.c_str() ) ).Valid() )
+ is.setstate( ios::badbit );
+ return is;
}
namespace vdrlive {