zypp::parser::susetags::ContentFileReader Class Reference

#include <ContentFileReader.h>

Inheritance diagram for zypp::parser::susetags::ContentFileReader:
[legend]

List of all members.

Public Types

typedef function
< void(const
data::Product_Ptr &)> 
ProductConsumer
typedef function
< void(const
RepoIndex_Ptr &)> 
RepoIndexConsumer

Public Member Functions

 ContentFileReader ()
 Default ctor.
virtual ~ContentFileReader ()
 Dtor.
virtual void parse (const InputStream &imput_r, const ProgressData::ReceiverFnc &fnc_r=ProgressData::ReceiverFnc())
 Parse the stream.
void setProductConsumer (const ProductConsumer &fnc_r)
 Consumer to call when product data were parsed.
void setRepoIndexConsumer (const RepoIndexConsumer &fnc_r)
 Consumer to call when repo index was parsed.

Protected Member Functions

virtual void beginParse ()
 Called when start parsing.
virtual void endParse ()
 Called when the parse is done.
virtual void userRequestedAbort (unsigned lineNo_r)
 Called when user(callback) request to abort.
std::string errPrefix (unsigned lineNo_r, const std::string &msg_r=std::string(), const std::string &line_r="-") const
 Prefix exception message with line information.

Private Attributes

RW_pointer< Impl,
rw_pointer::Scoped
< Impl > > 
_pimpl
ProductConsumer _productConsumer
RepoIndexConsumer _repoIndexConsumer

Classes

struct  Impl
 ContentFileReader implementation. More...


Detailed Description

Definition at line 52 of file ContentFileReader.h.


Member Typedef Documentation

typedef function<void(const data::Product_Ptr &)> zypp::parser::susetags::ContentFileReader::ProductConsumer

Definition at line 55 of file ContentFileReader.h.

typedef function<void(const RepoIndex_Ptr &)> zypp::parser::susetags::ContentFileReader::RepoIndexConsumer

Definition at line 56 of file ContentFileReader.h.


Constructor & Destructor Documentation

zypp::parser::susetags::ContentFileReader::ContentFileReader (  ) 

Default ctor.

Definition at line 215 of file ContentFileReader.cc.

zypp::parser::susetags::ContentFileReader::~ContentFileReader (  )  [virtual]

Dtor.

Definition at line 223 of file ContentFileReader.cc.


Member Function Documentation

void zypp::parser::susetags::ContentFileReader::parse ( const InputStream imput_r,
const ProgressData::ReceiverFnc fnc_r = ProgressData::ReceiverFnc() 
) [virtual]

Parse the stream.

Exceptions:
ParseException on errors.
AbortRequestException on user request. Invokes consume for each tag. consume might throw other exceptions as well.

Definition at line 290 of file ContentFileReader.cc.

References _pimpl, zypp::Exception::asString(), zypp::Arch::asString(), beginParse(), zypp::Arch::compare(), zypp::Arch::compatibleWith(), zypp::Dep::CONFLICTS, endParse(), zypp::Dep::ENHANCES, zypp::Rel::EQ, errPrefix(), zypp::ZConfig::instance(), zypp::iostr::EachLine::lineNo(), zypp::makeProgressData(), MIL, zypp::InputStream::name(), zypp::iostr::EachLine::next(), zypp::Dep::OBSOLETES, zypp::capability::parse(), zypp::Dep::PREREQUIRES, zypp::Dep::PROVIDES, zypp::Dep::RECOMMENDS, zypp::Dep::REQUIRES, zypp::ProgressData::sendTo(), zypp::ProgressData::set(), zypp::url::split(), zypp::InputStream::stream(), zypp::str::stripFirstWord(), zypp::Dep::SUGGESTS, zypp::Dep::SUPPLEMENTS, ticks, zypp::ProgressData::toMax(), zypp::ProgressData::toMin(), userRequestedAbort(), WAR, and ZYPP_THROW.

Referenced by zypp::repo::susetags::Downloader::download(), and zypp::parser::susetags::RepoParser::Impl::parse().

void zypp::parser::susetags::ContentFileReader::setProductConsumer ( const ProductConsumer fnc_r  )  [inline]

Consumer to call when product data were parsed.

Definition at line 74 of file ContentFileReader.h.

References _productConsumer.

Referenced by zypp::parser::susetags::RepoParser::Impl::parse().

void zypp::parser::susetags::ContentFileReader::setRepoIndexConsumer ( const RepoIndexConsumer fnc_r  )  [inline]

Consumer to call when repo index was parsed.

Definition at line 78 of file ContentFileReader.h.

References _repoIndexConsumer.

Referenced by zypp::repo::susetags::Downloader::download(), and zypp::parser::susetags::RepoParser::Impl::parse().

void zypp::parser::susetags::ContentFileReader::beginParse (  )  [protected, virtual]

Called when start parsing.

Definition at line 231 of file ContentFileReader.cc.

References _pimpl.

Referenced by parse().

void zypp::parser::susetags::ContentFileReader::endParse (  )  [protected, virtual]

Called when the parse is done.

Definition at line 241 of file ContentFileReader.cc.

References _pimpl, _productConsumer, _repoIndexConsumer, and MIL.

Referenced by parse().

void zypp::parser::susetags::ContentFileReader::userRequestedAbort ( unsigned  lineNo_r  )  [protected, virtual]

Called when user(callback) request to abort.

Exceptions:
AbortRequestException unless overloaded.

Definition at line 264 of file ContentFileReader.cc.

References errPrefix(), and ZYPP_THROW.

Referenced by parse().

std::string zypp::parser::susetags::ContentFileReader::errPrefix ( unsigned  lineNo_r,
const std::string &  msg_r = std::string(),
const std::string &  line_r = "-" 
) const [protected]

Prefix exception message with line information.

Definition at line 274 of file ContentFileReader.cc.

References _pimpl, and zypp::str::form().

Referenced by parse(), and userRequestedAbort().


Member Data Documentation

RW_pointer<Impl,rw_pointer::Scoped<Impl> > zypp::parser::susetags::ContentFileReader::_pimpl [private]

Definition at line 100 of file ContentFileReader.h.

Referenced by beginParse(), endParse(), errPrefix(), and parse().

ProductConsumer zypp::parser::susetags::ContentFileReader::_productConsumer [private]

Definition at line 102 of file ContentFileReader.h.

Referenced by endParse(), and setProductConsumer().

RepoIndexConsumer zypp::parser::susetags::ContentFileReader::_repoIndexConsumer [private]

Definition at line 103 of file ContentFileReader.h.

Referenced by endParse(), and setRepoIndexConsumer().


The documentation for this class was generated from the following files:
Generated on Tue Sep 25 19:23:22 2007 for libzypp by  doxygen 1.5.3