summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools.cpp44
1 files changed, 29 insertions, 15 deletions
diff --git a/tools.cpp b/tools.cpp
index b8c23ab..8053c3d 100644
--- a/tools.cpp
+++ b/tools.cpp
@@ -17,21 +17,35 @@ using namespace tnt;
istream& operator>>( istream& is, tChannelID& ret )
{
- 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;
+ /* alternativ implementation
+ string line;
+ if ( !getline( is, line ) ) {
+ if ( !is.eof() )
+ is.setstate( ios::badbit );
+ else
+ is.clear();
+ return is;
+ }
+ 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 {