zypp::target::rpm::librpmDb::db_const_iterator Class Reference

Subclass to retrieve database content. More...

#include <librpmDb.h>

List of all members.

Public Member Functions

 db_const_iterator (librpmDb::constPtr dbptr_r=0)
 Constructor.
 ~db_const_iterator ()
 Destructor.
shared_ptr< RpmExceptiondbError () const
 Return any database error.
void operator++ ()
 Advance to next RpmHeader::constPtr.
unsigned dbHdrNum () const
 Returns the current headers index in database, 0 if no header.
const RpmHeader::constPtroperator * () const
 Returns the current RpmHeader::constPtr or NULL, if no more entries available.
const RpmHeader::constPtroperator-> () const
 Forwards to the current RpmHeader::constPtr.
bool findAll ()
 Reset to iterate all packages.
bool findByFile (const std::string &file_r)
 Reset to iterate all packages that own a certain file.
bool findByProvides (const std::string &tag_r)
 Reset to iterate all packages that provide a certain tag.
bool findByRequiredBy (const std::string &tag_r)
 Reset to iterate all packages that require a certain tag.
bool findByConflicts (const std::string &tag_r)
 Reset to iterate all packages that conflict with a certain tag.
bool findByName (const std::string &name_r)
 Reset to iterate all packages with a certain name.
bool findPackage (const std::string &name_r)
 Find package by name.
bool findPackage (const std::string &name_r, const Edition &ed_r)
 Find package by name and edition.
bool findPackage (const Package::constPtr &which_r)
 Abbr.

Private Member Functions

db_const_iteratoroperator= (const db_const_iterator &)
 db_const_iterator (const db_const_iterator &)

Private Attributes

D_d

Friends

class librpmDb
std::ostream & operator<< (std::ostream &str, const db_const_iterator &obj)

Classes

class  D


Detailed Description

Subclass to retrieve database content.

Definition at line 432 of file librpmDb.h.


Constructor & Destructor Documentation

zypp::target::rpm::librpmDb::db_const_iterator::db_const_iterator const db_const_iterator  )  [private]
 

zypp::target::rpm::librpmDb::db_const_iterator::db_const_iterator librpmDb::constPtr  dbptr_r = 0  ) 
 

Constructor.

Iterator is initialized to findAll. The default form accesses librpmDb's default database. Explicitly providing a database handle should not be neccesary, except for testing.

Definition at line 657 of file librpmDb.cc.

References findAll().

zypp::target::rpm::librpmDb::db_const_iterator::~db_const_iterator  ) 
 

Destructor.

Definition at line 669 of file librpmDb.cc.

References _d.


Member Function Documentation

db_const_iterator& zypp::target::rpm::librpmDb::db_const_iterator::operator= const db_const_iterator  )  [private]
 

shared_ptr< RpmException > zypp::target::rpm::librpmDb::db_const_iterator::dbError  )  const
 

Return any database error.

NOTE: If the database gets blocked (see dbRelease) dbError will immediately report this, but an already running iteration will proceed to its end. Then the database is dropped.

Definition at line 713 of file librpmDb.cc.

References _d, zypp::target::rpm::librpmDb::db_const_iterator::D::_dberr, and zypp::target::rpm::librpmDb::db_const_iterator::D::_dbptr.

Referenced by zypp::target::rpm::RpmDb::doGetPackages(), and zypp::target::rpm::RpmDb::getData().

void zypp::target::rpm::librpmDb::db_const_iterator::operator++  ) 
 

Advance to next RpmHeader::constPtr.

Definition at line 680 of file librpmDb.cc.

References _d, and zypp::target::rpm::librpmDb::db_const_iterator::D::advance().

Referenced by findPackage().

unsigned zypp::target::rpm::librpmDb::db_const_iterator::dbHdrNum  )  const
 

Returns the current headers index in database, 0 if no header.

Definition at line 691 of file librpmDb.cc.

References _d, and zypp::target::rpm::librpmDb::db_const_iterator::D::offset().

const RpmHeader::constPtr & zypp::target::rpm::librpmDb::db_const_iterator::operator *  )  const
 

Returns the current RpmHeader::constPtr or NULL, if no more entries available.

Definition at line 702 of file librpmDb.cc.

References _d, and zypp::target::rpm::librpmDb::db_const_iterator::D::_hptr.

Referenced by findPackage().

const RpmHeader::constPtr& zypp::target::rpm::librpmDb::db_const_iterator::operator->  )  const [inline]
 

Forwards to the current RpmHeader::constPtr.

Definition at line 490 of file librpmDb.h.

bool zypp::target::rpm::librpmDb::db_const_iterator::findAll  ) 
 

Reset to iterate all packages.

Returns true if iterator contains at least one entry.

NOTE: No entry (false) migt be returned due to a meanwhile blocked database (see dbRelease). Use dbError to check this.

Definition at line 742 of file librpmDb.cc.

References _d, and zypp::target::rpm::librpmDb::db_const_iterator::D::init().

Referenced by db_const_iterator().

bool zypp::target::rpm::librpmDb::db_const_iterator::findByFile const std::string &  file_r  ) 
 

Reset to iterate all packages that own a certain file.

Definition at line 753 of file librpmDb.cc.

References _d, and zypp::target::rpm::librpmDb::db_const_iterator::D::init().

Referenced by zypp::target::rpm::RpmDb::hasFile(), and zypp::target::rpm::RpmDb::whoOwnsFile().

bool zypp::target::rpm::librpmDb::db_const_iterator::findByProvides const std::string &  tag_r  ) 
 

Reset to iterate all packages that provide a certain tag.

Definition at line 764 of file librpmDb.cc.

References _d, and zypp::target::rpm::librpmDb::db_const_iterator::D::init().

Referenced by zypp::target::rpm::RpmDb::hasProvides().

bool zypp::target::rpm::librpmDb::db_const_iterator::findByRequiredBy const std::string &  tag_r  ) 
 

Reset to iterate all packages that require a certain tag.

Definition at line 775 of file librpmDb.cc.

References _d, and zypp::target::rpm::librpmDb::db_const_iterator::D::init().

Referenced by zypp::target::rpm::RpmDb::hasRequiredBy().

bool zypp::target::rpm::librpmDb::db_const_iterator::findByConflicts const std::string &  tag_r  ) 
 

Reset to iterate all packages that conflict with a certain tag.

Definition at line 786 of file librpmDb.cc.

References _d, and zypp::target::rpm::librpmDb::db_const_iterator::D::init().

Referenced by zypp::target::rpm::RpmDb::hasConflicts().

bool zypp::target::rpm::librpmDb::db_const_iterator::findByName const std::string &  name_r  ) 
 

Reset to iterate all packages with a certain name.

NOTE: Multiple entries for one package installed in different versions are possible but not desired. Usually you'll want to use findPackage instead.

findByName is needed to retrieve pseudo packages like 'gpg-pubkey', which in fact exist in multiple instances.

Referenced by zypp::target::rpm::RpmDb::pubkeyEditions(), and zypp::target::rpm::RpmDb::pubkeys().

bool zypp::target::rpm::librpmDb::db_const_iterator::findPackage const std::string &  name_r  ) 
 

Find package by name.

Multiple entries for one package installed in different versions are possible but not desired. If so, the last package installed is returned.

Referenced by zypp::target::rpm::RpmDb::fileList(), findPackage(), and zypp::target::rpm::RpmDb::getData().

bool zypp::target::rpm::librpmDb::db_const_iterator::findPackage const std::string &  name_r,
const Edition ed_r
 

Find package by name and edition.

Commonly used by PMRpmPackageDataProvider.

Definition at line 835 of file librpmDb.cc.

References _d, zypp::target::rpm::librpmDb::db_const_iterator::D::init(), zypp::target::rpm::librpmDb::db_const_iterator::D::offset(), operator *(), operator++(), and zypp::target::rpm::librpmDb::db_const_iterator::D::set().

bool zypp::target::rpm::librpmDb::db_const_iterator::findPackage const Package::constPtr which_r  ) 
 

Abbr.

for findPackage( which_r->name(), which_r->edition() );

Definition at line 856 of file librpmDb.cc.

References _d, zypp::target::rpm::librpmDb::db_const_iterator::D::destroy(), and findPackage().


Friends And Related Function Documentation

friend class librpmDb [friend]
 

Definition at line 436 of file librpmDb.h.

std::ostream& operator<< std::ostream &  str,
const db_const_iterator obj
[friend]
 


Member Data Documentation

D& zypp::target::rpm::librpmDb::db_const_iterator::_d [private]
 

Definition at line 443 of file librpmDb.h.

Referenced by dbError(), dbHdrNum(), findAll(), findByConflicts(), findByFile(), findByProvides(), findByRequiredBy(), findPackage(), operator *(), operator++(), zypp::target::rpm::operator<<(), and ~db_const_iterator().


The documentation for this class was generated from the following files:
Generated on Thu Jul 6 00:07:35 2006 for zypp by  doxygen 1.4.6