Classes | |
class | EachLine |
Simple lineparser: Traverse each line in a file. 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. | |
std::ostream & | copy (std::istream &from_r, std::ostream &to_r) |
Copy istream to ostream. | |
std::ostream & | copyIndent (std::istream &from_r, std::ostream &to_r, const std::string &indent_r="> ") |
Copy istream to ostream, prefixing each line with indent_r (default "> " ). | |
void | tee (std::istream &from_r, std::ostream &to1_r, std::ostream &to2_r) |
Copy istream to ostream, prefixing each line with indent_r (default "> " ). | |
template<class _Function > | |
_Function & | forEachLine (std::istream &str_r, _Function &consume_r) |
Simple lineparser: Call functor consume_r for each line. |
typedef boost::io::ios_base_all_saver zypp::iostr::IosFmtFlagsSaver |
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.
Definition at line 31 of file IOStream.cc.
Referenced by zypp::ExternalProgram::close(), zypp::DiskUsageCounter::detectMountPoints(), forEachLine(), zypp::media::MediaHandler::getDirectoryYast(), zypp::PluginFrame::Impl::Impl(), zypp::repo::SUSEMediaVerifier::isDesiredMedia(), zypp::iostr::EachLine::next(), zypp::base::sysconfig::read(), zypp::Fetcher::Impl::readSha1sumsIndex(), zypp::externalprogram::ExternalDataSource::receiveLine(), zypp::repo::RepoMediaAccess::Impl::setVerifierForRepo(), and zypp::repo::SUSEMediaVerifier::SUSEMediaVerifier().
std::ostream& zypp::iostr::copy | ( | std::istream & | from_r, | |
std::ostream & | to_r | |||
) | [inline] |
Copy istream to ostream.
Definition at line 49 of file IOStream.h.
Referenced by zypp::url::UrlBase::cleanupPathName(), zypp::Fetcher::Impl::getDirectoryContent(), zypp::media::MediaHandler::getFileCopy(), zypp::RepoManager::getRepositoriesInService(), zypp::PublicKey::Impl::Impl(), zypp::target::rpm::RpmDb::internal_initDatabase(), and zypp::target::rpm::RpmDb::run_rpm().
std::ostream& zypp::iostr::copyIndent | ( | std::istream & | from_r, | |
std::ostream & | to_r, | |||
const std::string & | indent_r = "> " | |||
) | [inline] |
Copy istream to ostream, prefixing each line with indent_r (default "> "
).
Definition at line 63 of file IOStream.h.
Referenced by zypp::PluginScript::Impl::send().
void zypp::iostr::tee | ( | std::istream & | from_r, | |
std::ostream & | to1_r, | |||
std::ostream & | to2_r | |||
) | [inline] |
Copy istream to ostream, prefixing each line with indent_r (default "> "
).
Definition at line 83 of file IOStream.h.
_Function& zypp::iostr::forEachLine | ( | std::istream & | str_r, | |
_Function & | consume_r | |||
) | [inline] |
Simple lineparser: Call functor consume_r for each line.
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 ) { ... } }; |
void
consumer. Definition at line 191 of file IOStream.h.
References getline().