zypp::iostr Namespace Reference

Iostream related utilities. More...


Typedefs

typedef boost::io::ios_base_all_saver IosFmtFlagsSaver
 Save and restore streams width, precision and fmtflags.

Functions

std::string getline (std::istream &str)
 Read one line from stream.
template<class _Function>
_Function & forEachLine (std::istream &str_r, _Function &consume_r)
 Simple lineparser: Call functor consume_r for each line.


Detailed Description

Iostream related utilities.

Typedef Documentation

typedef boost::io::ios_base_all_saver zypp::iostr::IosFmtFlagsSaver
 

Save and restore streams width, precision and fmtflags.

Definition at line 32 of file IOStream.h.


Function Documentation

std::string zypp::iostr::getline std::istream &  str  ) 
 

Read one line from stream.

Reads everything up to the next newline or EOF. newline is read but not returned.

See also:
forEachLine

Definition at line 31 of file IOStream.cc.

Referenced by zypp::DiskUsageCounter::detectMountPoints(), zypp::storage::XMLFilesBackend::flagsFromFile(), forEachLine(), zypp::source::SourceImpl::Verifier::isDesiredMedia(), zypp::source::susetags::ProductMetadataParser::parse(), zypp::source::susetags::MediaPatchesMetadataParser::parse(), zypp::source::susetags::MediaMetadataParser::parse(), zypp::parser::tagfile::TagFileParser::parse(), zypp::source::susetags::SuseTagsImpl::providePatterns(), zypp::source::susetags::SuseTagsImpl::provideSelections(), zypp::externalprogram::ExternalDataSource::receiveLine(), zypp::SourceCache::removeSource(), and zypp::SourceCache::restoreSources().

template<class _Function>
_Function& zypp::iostr::forEachLine std::istream &  str_r,
_Function &  consume_r
 

Simple lineparser: Call functor consume_r for each line.

Parameters:
str_r The istream to read from.
consume_r A reference to a function or functor. The loop is aborted if the function returns false.
 bool consume( const std::string & )
 { ... }

 struct Consume : public std::unary_function<const std::string &, bool>
 {
   bool operator()( const std::string & line_r )
   { ... }
 };
Returns:
A reference to consume_r.
Todo:
Should be templated and specialized according to the functors return type, to allow void consumer.

Definition at line 67 of file IOStream.h.

References getline().

Referenced by zypp::dumpFile().


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