try
{
// bulid Package deps.
- _caps.insert( _factory.parse( ResTraits<Package>::kind, line_r ) );
+ _caps.insert( _factory.parse( ResKind::package, line_r ) );
}
catch( Exception & excpt_r )
{
{
ZYpp::Ptr z = getZYpp();
-// CapabilityImpl::Ptr freak = capability::parse( ResTraits<Package>::kind, "libc.so.6");
+// CapabilityImpl::Ptr freak = capability::parse( ResKind::package, "libc.so.6");
// MIL << freak << endl;
// MIL << "isVer: " << isKind<VersionedCap>(freak) << endl;
// MIL << "isNam: " << isKind<NamedCap>(freak) << endl;
while (file && !file.eof())
{
getline(file, buffer);
- CapabilityImpl::Ptr cap = capability::parse( ResTraits<Package>::kind, buffer );
+ CapabilityImpl::Ptr cap = capability::parse( ResKind::package, buffer );
if ( cap == 0L )
{
//ZYPP_THROW(Exception("Invalid capability: [" + buffer + "]"));
for ( list<CapabilityImpl::Ptr>::const_iterator it = caps.begin(); it != caps.end(); ++it )
{
CapabilityImpl::Ptr cap = *it;
- if ( ( ! cap ) || ( cap->refers() != ResTraits<Package>::kind ) )
+ if ( ( ! cap ) || ( cap->refers() != ResKind::package ) )
{
ERR << "Invalid capability : [" << buffer << "]" << endl;
continue;
public:
DataCollect( bool verbose_r = true )
: _definst( false )
- , _defkind( ResTraits<Package>::kind )
+ , _defkind( ResKind::package )
, _defdep( Dep::PROVIDES )
, _defdepref( _defkind )
, _verbose( verbose_r )
if ( _d )
{
ResObject::Ptr p;
- if ( _d->_kind == ResTraits<Package>::kind )
+ if ( _d->_kind == ResKind::package )
p = make<Package>();
- else if ( _d->_kind == ResTraits<SrcPackage>::kind )
+ else if ( _d->_kind == ResKind::srcpackage )
p = make<SrcPackage>();
else if ( _d->_kind == ResTraits<Selection>::kind )
p = make<Selection>();
- else if ( _d->_kind == ResTraits<Pattern>::kind )
+ else if ( _d->_kind == ResKind::pattern )
p = make<Pattern>();
- else if ( _d->_kind == ResTraits<Product>::kind )
+ else if ( _d->_kind == ResKind::product )
p = make<Product>();
- else if ( _d->_kind == ResTraits<Patch>::kind )
+ else if ( _d->_kind == ResKind::patch )
p = make<Patch>();
else if ( _d->_kind == ResTraits<Script>::kind )
p = make<Script>();
std::vector< std::vector<string> > packIDs = dbPackages->getResult();
- Resolvable::Kind kind = ResTraits<Package>::kind;
+ Resolvable::Kind kind = ResKind::package;
CapFactory factory;
for(unsigned int i = 0; i < packIDs.size(); i++){
std::vector< std::vector<string> > packIDs = dbPackages->getResult();
std::cout << "get packages from db...\n";
- Resolvable::Kind kind = ResTraits<Package>::kind;
+ Resolvable::Kind kind = ResKind::package;
CapFactory factory;
for(unsigned int i = 2000; i < packIDs.size(); i++){
#define FILTER_ALL "all"
if ( filter.empty() ) filter = FILTER_ALL;
- if (filter == "packages") kind = ResTraits<zypp::Package>::kind;
- else if (filter == "patches") kind = ResTraits<zypp::Patch>::kind;
- else if (filter == "patterns") kind = ResTraits<zypp::Pattern>::kind;
- else if (filter == "products") kind = ResTraits<zypp::Product>::kind;
+ if (filter == "packages") kind = ResKind::package;
+ else if (filter == "patches") kind = ResKind::patch;
+ else if (filter == "patterns") kind = ResKind::pattern;
+ else if (filter == "products") kind = ResKind::product;
else if (filter != FILTER_ALL)
{
std::cerr << "usage: zypp-query-pool [--registrable|-r] [packages|patches|patterns|products] [<alias>]" << endl;
*
* // print and count all Packages named "kernel"
* counter = 0;
- * store.forEach( chain( ByKind(ResTraits<Package>::kind),
+ * store.forEach( chain( ByKind(ResKind::package),
* ByName("kernel") ),
* PrintAndCount(counter) );
*
* // print and count all Packages not named "kernel"
* counter = 0;
- * store.forEach( chain( ByKind(ResTraits<Package>::kind),
+ * store.forEach( chain( ByKind(ResKind::package),
* not_c(ByName("kernel")) ),
* PrintAndCount(counter) );
*
* // same as above ;)
* counter = 0;
- * store.forEach( chain( ByKind(ResTraits<Package>::kind),
+ * store.forEach( chain( ByKind(ResKind::package),
* chain( not_c(ByName("kernel")),
* PrintAndCount(counter) ) ),
* true_c() );
template<>
const ResKind ResTraits<Product> ::kind( ResKind::product );
template<>
- const ResKind ResTraits<SrcPackage>::kind( ResKind::srcpackage );
+ const ResKind ResKind::srcpackage( ResKind::srcpackage );
std::string ResKind::satIdent( const ResKind & refers_r, const std::string & name_r )
{
/** Convenient access to well known ResKinds.
* \code
- * ResKind packagekind = ResTraits<Package>::kind;
+ * ResKind packagekind = ResKind::package;
* ResKind packagekind = resKind<Package>();
* \endcode
*/
/** Convenient test for ResKinds.
* \code
* ResKind value;
- * if ( ResTraits<Package>::kind == value )
+ * if ( ResKind::package == value )
* if ( resKind<Package>() == value )
* if ( isKind<Package>( value ) )
* \endcode
{
if (it->status().isToBeInstalled())
{
- if ((*it)->kind() == ResTraits<SrcPackage>::kind) {
+ if ((*it)->kind() == ResKind::srcpackage) {
srclist_r.push_back( *it );
}
else
ostringstream os;
if (!item) return "";
- if (item->kind() != ResTraits<zypp::Package>::kind)
+ if (item->kind() != ResKind::package)
os << item->kind() << ':';
os << item->name();
if (!shortVersion) {
ostringstream os;
if (!item) return "";
- if (item->kind() != ResTraits<zypp::Package>::kind)
+ if (item->kind() != ResKind::package)
os << item->kind() << ':';
os << item->name();
if (!shortVersion) {
{
try
{
- dataCollect[Dep::PROVIDES].insert(capfactory.fromImpl(capability::buildFile(ResTraits<Package>::kind, *filename) ));
+ dataCollect[Dep::PROVIDES].insert(capfactory.fromImpl(capability::buildFile(ResKind::package, *filename) ));
}
catch (Exception & excpt_r)
{
WAR << "rpmdb.findByFile returned unknown package " << *iter << endl;
continue;
}
- pptr->injectProvides(_f.parse(ResTraits<Package>::kind, *it));
+ pptr->injectProvides(_f.parse(ResKind::package, *it));
}
}
#endif