Mailinglist Archive: zypp-commit (149 mails)

< Previous Next >
[zypp-commit] r5415 - in /trunk/libzypp/zypp/base: IOStream.cc IOStream.h InputStream.h
  • From: mlandres@xxxxxxxxxxxxxxxx
  • Date: Thu, 19 Apr 2007 15:43:01 -0000
  • Message-id: <20070419154301.4B0363559C@xxxxxxxxxxxxxxxx>
Author: mlandres
Date: Thu Apr 19 17:43:00 2007
New Revision: 5415

URL: http://svn.opensuse.org/viewcvs/zypp?rev=5415&view=rev
Log:
support line numbers in lineparser

Modified:
    trunk/libzypp/zypp/base/IOStream.cc
    trunk/libzypp/zypp/base/IOStream.h
    trunk/libzypp/zypp/base/InputStream.h

Modified: trunk/libzypp/zypp/base/IOStream.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/base/IOStream.cc?rev=5415&r1=5414&r2=5415&view=diff
==============================================================================
--- trunk/libzypp/zypp/base/IOStream.cc (original)
+++ trunk/libzypp/zypp/base/IOStream.cc Thu Apr 19 17:43:00 2007
@@ -53,9 +53,9 @@
     // METHOD NAME : EachLine::EachLine
     // METHOD TYPE : Ctor
     //
-    EachLine::EachLine( std::istream & str_r )
+    EachLine::EachLine( std::istream & str_r, unsigned lineNo_r )
       : _str( str_r )
-      , _lineNo( 0 )
+      , _lineNo( lineNo_r )
       , _valid( true )
     {
       next();

Modified: trunk/libzypp/zypp/base/IOStream.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/base/IOStream.h?rev=5415&r1=5414&r2=5415&view=diff
==============================================================================
--- trunk/libzypp/zypp/base/IOStream.h (original)
+++ trunk/libzypp/zypp/base/IOStream.h Thu Apr 19 17:43:00 2007
@@ -63,9 +63,9 @@
 
       public:
        /** Ctor taking a stream and reading the 1st line from it. */
-       EachLine( std::istream & str_r );
+       EachLine( std::istream & str_r, unsigned lineNo_r = 0 );
 
-       /** Evaluate class in a  boolean context. */
+       /** Evaluate class in a boolean context. */
        using SafeBool::operator bool_type;
 
        /** Whether \c this contains a valid line to consume. */
@@ -76,6 +76,10 @@
        unsigned lineNo() const
        { return _lineNo; }
 
+       /** Set current line number. */
+       void setLineNo( unsigned lineNo_r )
+       { _lineNo = lineNo_r; }
+
        /** Access the current line. */
        const std::string & operator*() const
        { return _line; }

Modified: trunk/libzypp/zypp/base/InputStream.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/base/InputStream.h?rev=5415&r1=5414&r2=5415&view=diff
==============================================================================
--- trunk/libzypp/zypp/base/InputStream.h (original)
+++ trunk/libzypp/zypp/base/InputStream.h Thu Apr 19 17:43:00 2007
@@ -93,7 +93,7 @@
     { return *_stream; }
 
     /** Allow implicit conversion to std::istream.*/
-    operator std::istream &()
+    operator std::istream &() const
     { return *_stream; }
 
     /** Name of the std::istream.

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages