|
libzypp
9.1.2
|
Build string to identify/retrieve a specific Solvable. More...
#include <InstanceId.h>
Public Member Functions | |
| InstanceId () | |
| Default ctor empty empty namespace. | |
| InstanceId (const std::string &namespace_r) | |
| Ctor taking namespace. | |
| std::string | getIdFor (sat::Solvable slv_r) const |
| Solvable to InstanceId string. | |
| std::string | getIdFor (const PoolItem &pi_r) const |
| PoolItem to InstanceId string. | |
| sat::Solvable | findSolvable (const std::string str_r) const |
| InstanceId string to Solvable. | |
| PoolItem | findPoolItem (const std::string str_r) const |
| InstanceId string to PoolItem. | |
| std::string | operator() (sat::Solvable slv_r) const |
| Solvable to InstanceId string. | |
| std::string | operator() (const PoolItem &pi_r) const |
| PoolItem to InstanceId string. | |
| PoolItem | operator() (const std::string str_r) const |
| InstanceId string to PoolItem. | |
| bool | isSystemId (const std::string str_r) const |
| Quick test whether the InstanceId string would refer to a system (installed) Solvable. | |
| const std::string & | getNamespace () const |
| The namespace in use. | |
| void | setNamespace (const std::string &namespace_r) |
| Set a new namespace. | |
| void | unsetNamespace () |
| Set no (empty) namespace. | |
Private Attributes | |
| std::string | _namespace |
Build string to identify/retrieve a specific Solvable.
"[<namespace>:]<name>-<version>-<release>.<arch>@<repoalias>"
Any namespace that prepends the InstanceIds must be passed to the ctor. Conversion to/from instanceId can be done via function call operator().
InstanceId instanceId( "SUSE:" ); // using a namespace ResPool pool( ResPool::instance() ); for_( it, pool.begin(), pool.end() ) { std::cout << instanceId(*it) << endl; }
Definition at line 46 of file InstanceId.h.
| zypp::InstanceId::InstanceId | ( | ) | [inline] |
Default ctor empty empty namespace.
Definition at line 50 of file InstanceId.h.
| zypp::InstanceId::InstanceId | ( | const std::string & | namespace_r | ) | [inline] |
Ctor taking namespace.
Definition at line 54 of file InstanceId.h.
| std::string zypp::InstanceId::getIdFor | ( | sat::Solvable | slv_r | ) | const |
Solvable to InstanceId string.
Definition at line 25 of file InstanceId.cc.
References _namespace, zypp::Repository::alias(), zypp::sat::Solvable::arch(), zypp::Arch::c_str(), zypp::IdString::c_str(), zypp::IdStringType< Derived >::c_str(), zypp::sat::Solvable::edition(), zypp::str::form(), zypp::sat::Solvable::ident(), zypp::sat::Solvable::isKind(), zypp::Edition::release(), zypp::sat::Solvable::repository(), zypp::ResKind::srcpackage, and zypp::Edition::version().
Referenced by operator()().
| std::string zypp::InstanceId::getIdFor | ( | const PoolItem & | pi_r | ) | const [inline] |
PoolItem to InstanceId string.
Definition at line 62 of file InstanceId.h.
References getIdFor(), and zypp::PoolItem::satSolvable().
Referenced by getIdFor().
| sat::Solvable zypp::InstanceId::findSolvable | ( | const std::string | str_r | ) | const [inline] |
InstanceId string to Solvable.
Definition at line 66 of file InstanceId.h.
References findPoolItem(), and zypp::PoolItem::satSolvable().
| PoolItem zypp::InstanceId::findPoolItem | ( | const std::string | str_r | ) | const |
InstanceId string to PoolItem.
Definition at line 49 of file InstanceId.cc.
References _namespace, zypp::ResPool::byIdentBegin(), zypp::ResPool::byIdentEnd(), for_, zypp::str::hasPrefix(), zypp::sat::Pool::instance(), and zypp::ResPool::instance().
Referenced by findSolvable(), and operator()().
| std::string zypp::InstanceId::operator() | ( | sat::Solvable | slv_r | ) | const [inline] |
| std::string zypp::InstanceId::operator() | ( | const PoolItem & | pi_r | ) | const [inline] |
| PoolItem zypp::InstanceId::operator() | ( | const std::string | str_r | ) | const [inline] |
InstanceId string to PoolItem.
Definition at line 81 of file InstanceId.h.
References findPoolItem().
| bool zypp::InstanceId::isSystemId | ( | const std::string | str_r | ) | const |
Quick test whether the InstanceId string would refer to a system (installed) Solvable.
Definition at line 109 of file InstanceId.cc.
References zypp::str::hasSuffix(), and zypp::Repository::systemRepoAlias().
| const std::string& zypp::InstanceId::getNamespace | ( | ) | const [inline] |
| void zypp::InstanceId::setNamespace | ( | const std::string & | namespace_r | ) | [inline] |
| void zypp::InstanceId::unsetNamespace | ( | ) | [inline] |
std::string zypp::InstanceId::_namespace [private] |
Definition at line 102 of file InstanceId.h.
Referenced by findPoolItem(), getIdFor(), getNamespace(), setNamespace(), and unsetNamespace().
1.7.6.1