IOStream.cc

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00012 #include <iostream>
00013 //#include "zypp/base/Logger.h"
00014 
00015 #include "zypp/base/IOStream.h"
00016 
00017 using std::endl;
00018 
00020 namespace zypp
00021 { 
00022 
00023   namespace iostr
00024   { 
00025 
00026     /******************************************************************
00027      **
00028      ** FUNCTION NAME : getline
00029      ** FUNCTION TYPE : std::string
00030     */
00031     std::string getline( std::istream & str )
00032     {
00033       static const unsigned tmpBuffLen = 1024;
00034       static char           tmpBuff[tmpBuffLen];
00035       std::string ret;
00036       do {
00037         str.clear();
00038         str.getline( tmpBuff, tmpBuffLen ); // always writes '\0' terminated
00039         ret += tmpBuff;
00040       } while( str.rdstate() == std::ios::failbit );
00041 
00042       return ret;
00043     }
00044 
00046   } // namespace iostr
00049 } // namespace zypp

Generated on Thu Jul 6 00:07:20 2006 for zypp by  doxygen 1.4.6