41 typedef intrusive_ptr<librpmDb>
Ptr;
42 typedef intrusive_ptr<const librpmDb>
constPtr;
122 static std::string
expand(
const std::string & macro_r );
129 return std::string(
"'(" ) + root_r.
asString() +
")" + sub_r.
asString() +
"'";
189 static unsigned dbRelease(
bool force_r =
false );
230 class db_const_iterator;
256 virtual void unref_to(
unsigned refCount_r )
const;
279 shared_ptr<RpmException>
error()
const;
297 unsigned size()
const;
309 virtual std::ostream &
dumpOn( std::ostream &
str )
const;
359 shared_ptr<RpmException>
dbError()
const;
401 bool findByFile(
const std::string & file_r );
428 bool findByName(
const std::string & name_r );
void * dont_call_it() const
Dont call it ;) It's for development and testing only.
static const Pathname & defaultRoot()
static bool _dbBlocked
Whether access is blocked (no _defaultDb will be available).
static unsigned blockAccess()
Blocks further access to rpmdb.
friend std::ostream & operator<<(std::ostream &str, const db_const_iterator &obj)
void operator++()
Advance to next RpmHeader::constPtr.
bool findByProvides(const std::string &tag_r)
Reset to iterate all packages that provide a certain tag.
static std::string expand(const std::string ¯o_r)
static void dbAccess()
Access the database at the current default location.
String related utilities and Regular expression matching.
bool findByRequiredBy(const std::string &tag_r)
Reset to iterate all packages that require a certain tag.
librpmDb(const Pathname &root_r, const Pathname &dbPath_r, bool readonly_r)
Private constructor! librpmDb objects are to be created via static interface only.
Edition represents [epoch:]version[-release]
virtual void unref_to(unsigned refCount_r) const
Trigger from Rep, after refCount was decreased.
db_const_iterator(const db_const_iterator &)
Subclass to retrieve database content.
static librpmDb::constPtr _defaultDb
Current rpmdb handle.
intrusive_ptr< librpmDb > Ptr
static librpmDb * newLibrpmDb()
For internal use.
virtual ~librpmDb()
Destructor.
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
shared_ptr< RpmException > dbError() const
Return any database error.
const std::string & asString() const
String representation.
static Pathname _defaultRoot
Current root directory for all operations.
static const Pathname & defaultDbPath()
bool findByName(const std::string &name_r)
Reset to iterate all packages with a certain name.
static unsigned dbRelease(bool force_r=false)
If there are no outstanding references to the database (e.g.
shared_ptr< RpmException > error() const
Return any database error.
bool findByFile(const std::string &file_r)
Reset to iterate all packages that own a certain file.
Base class for reference counted objects.
const Pathname & root() const
Manage access to librpm database.
bool findPackage(const std::string &name_r)
Find package by name.
const RpmHeader::constPtr & operator->() const
Forwards to the current RpmHeader::constPtr.
static void unblockAccess()
Allow access to rpmdb e.g.
bool findAll()
Reset to iterate all packages.
db_const_iterator & operator=(const db_const_iterator &)
librpmDb internal database handle
const RpmHeader::constPtr & operator*() const
Returns the current RpmHeader::constPtr or NULL, if no more entries available.
static bool globalInit()
Initialize lib librpm (read configfiles etc.).
~db_const_iterator()
Destructor.
static const Pathname _defaultDbPath
Current directory (below root) that contains the rpmdb.
bool findByConflicts(const std::string &tag_r)
Reset to iterate all packages that conflict with a certain tag.
virtual std::ostream & dumpOn(std::ostream &str) const
Dump debug info.
unsigned dbHdrNum() const
Returns the current headers index in database, 0 if no header.
const Pathname & dbPath() const
intrusive_ptr< const librpmDb > constPtr
Easy-to use interface to the ZYPP dependency resolver.
static std::ostream & dumpState(std::ostream &str)
Dump debug info.
static std::string stringPath(const Pathname &root_r, const Pathname &sub_r)
TraitsType::constPtrType constPtr