Author: mlandres Date: Fri Aug 8 13:38:54 2008 New Revision: 10798 URL: http://svn.opensuse.org/viewcvs/zypp?rev=10798&view=rev Log: replace ResTraits<>::kind by ResKind Modified: trunk/libzypp/devel/Example.createCapabilities.cc trunk/libzypp/devel/devel.dmacvicar/CacheStore_tp.cc trunk/libzypp/devel/devel.ma/FakePool.h trunk/libzypp/devel/devel.shaas/PdbToZypp/pdbtozypp.cc trunk/libzypp/devel/devel.shaas/old/dbmain.cc trunk/libzypp/tools/registration/zypp-query-pool.cc trunk/libzypp/zypp/ResFilters.h trunk/libzypp/zypp/ResKind.cc trunk/libzypp/zypp/ResTraits.h trunk/libzypp/zypp/pool/GetResolvablesToInsDel.cc trunk/libzypp/zypp/solver/detail/Helper.cc trunk/libzypp/zypp/solver/detail/SATResolver.cc trunk/libzypp/zypp/target/rpm/RpmDb.cc Modified: trunk/libzypp/devel/Example.createCapabilities.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/Example.createCapabilities.cc?rev=10798&r1=10797&r2=10798&view=diff ============================================================================== --- trunk/libzypp/devel/Example.createCapabilities.cc (original) +++ trunk/libzypp/devel/Example.createCapabilities.cc Fri Aug 8 13:38:54 2008 @@ -137,7 +137,7 @@ 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 ) { Modified: trunk/libzypp/devel/devel.dmacvicar/CacheStore_tp.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.dmacvicar/CacheStore_tp.cc?rev=10798&r1=10797&r2=10798&view=diff ============================================================================== --- trunk/libzypp/devel/devel.dmacvicar/CacheStore_tp.cc (original) +++ trunk/libzypp/devel/devel.dmacvicar/CacheStore_tp.cc Fri Aug 8 13:38:54 2008 @@ -31,7 +31,7 @@ { 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; @@ -52,7 +52,7 @@ 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 + "]")); @@ -69,7 +69,7 @@ for ( listCapabilityImpl::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; Modified: trunk/libzypp/devel/devel.ma/FakePool.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/FakePool.h?rev=10798&r1=10797&r2=10798&view=diff ============================================================================== --- trunk/libzypp/devel/devel.ma/FakePool.h (original) +++ trunk/libzypp/devel/devel.ma/FakePool.h Fri Aug 8 13:38:54 2008 @@ -60,7 +60,7 @@ public: DataCollect( bool verbose_r = true ) : _definst( false ) - , _defkind( ResTraits<Package>::kind ) + , _defkind( ResKind::package ) , _defdep( Dep::PROVIDES ) , _defdepref( _defkind ) , _verbose( verbose_r ) @@ -160,17 +160,17 @@ 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>(); Modified: trunk/libzypp/devel/devel.shaas/PdbToZypp/pdbtozypp.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.shaas/PdbToZypp/pdbtozypp.cc?rev=10798&r1=10797&r2=10798&view=diff ============================================================================== --- trunk/libzypp/devel/devel.shaas/PdbToZypp/pdbtozypp.cc (original) +++ trunk/libzypp/devel/devel.shaas/PdbToZypp/pdbtozypp.cc Fri Aug 8 13:38:54 2008 @@ -33,7 +33,7 @@ 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++){ Modified: trunk/libzypp/devel/devel.shaas/old/dbmain.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.shaas/old/dbmain.cc?rev=10798&r1=10797&r2=10798&view=diff ============================================================================== --- trunk/libzypp/devel/devel.shaas/old/dbmain.cc (original) +++ trunk/libzypp/devel/devel.shaas/old/dbmain.cc Fri Aug 8 13:38:54 2008 @@ -68,7 +68,7 @@ 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++){ Modified: trunk/libzypp/tools/registration/zypp-query-pool.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tools/registration/zypp-query-pool.cc?rev=10798&r1=10797&r2=10798&view=diff ============================================================================== --- trunk/libzypp/tools/registration/zypp-query-pool.cc (original) +++ trunk/libzypp/tools/registration/zypp-query-pool.cc Fri Aug 8 13:38:54 2008 @@ -100,10 +100,10 @@ #define FILTER_ALL "all" if ( filter.empty() ) filter = FILTER_ALL; - if (filter == "packages") kind = ResTraitszypp::Package::kind; - else if (filter == "patches") kind = ResTraitszypp::Patch::kind; - else if (filter == "patterns") kind = ResTraitszypp::Pattern::kind; - else if (filter == "products") kind = ResTraitszypp::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; Modified: trunk/libzypp/zypp/ResFilters.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ResFilters.h?rev=10798&r1=10797&r2=10798&view=diff ============================================================================== --- trunk/libzypp/zypp/ResFilters.h (original) +++ trunk/libzypp/zypp/ResFilters.h Fri Aug 8 13:38:54 2008 @@ -75,19 +75,19 @@ * * // 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() ); Modified: trunk/libzypp/zypp/ResKind.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ResKind.cc?rev=10798&r1=10797&r2=10798&view=diff ============================================================================== --- trunk/libzypp/zypp/ResKind.cc (original) +++ trunk/libzypp/zypp/ResKind.cc Fri Aug 8 13:38:54 2008 @@ -38,7 +38,7 @@ 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 ) { Modified: trunk/libzypp/zypp/ResTraits.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ResTraits.h?rev=10798&r1=10797&r2=10798&view=diff ============================================================================== --- trunk/libzypp/zypp/ResTraits.h (original) +++ trunk/libzypp/zypp/ResTraits.h Fri Aug 8 13:38:54 2008 @@ -94,7 +94,7 @@ /** Convenient access to well known ResKinds. * \code - * ResKind packagekind = ResTraits<Package>::kind; + * ResKind packagekind = ResKind::package; * ResKind packagekind = resKind<Package>(); * \endcode */ @@ -104,7 +104,7 @@ /** 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 Modified: trunk/libzypp/zypp/pool/GetResolvablesToInsDel.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/pool/GetResolvablesToInsDel.cc?rev=10798&r1=10797&r2=10798&view=diff ============================================================================== --- trunk/libzypp/zypp/pool/GetResolvablesToInsDel.cc (original) +++ trunk/libzypp/zypp/pool/GetResolvablesToInsDel.cc Fri Aug 8 13:38:54 2008 @@ -111,7 +111,7 @@ { if (it->status().isToBeInstalled()) { - if ((*it)->kind() == ResTraits<SrcPackage>::kind) { + if ((*it)->kind() == ResKind::srcpackage) { srclist_r.push_back( *it ); } else Modified: trunk/libzypp/zypp/solver/detail/Helper.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/Helper.cc?rev=10798&r1=10797&r2=10798&view=diff ============================================================================== --- trunk/libzypp/zypp/solver/detail/Helper.cc (original) +++ trunk/libzypp/zypp/solver/detail/Helper.cc Fri Aug 8 13:38:54 2008 @@ -265,7 +265,7 @@ ostringstream os; if (!item) return ""; - if (item->kind() != ResTraitszypp::Package::kind) + if (item->kind() != ResKind::package) os << item->kind() << ':'; os << item->name(); if (!shortVersion) { Modified: trunk/libzypp/zypp/solver/detail/SATResolver.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/SATResolver.cc?rev=10798&r1=10797&r2=10798&view=diff ============================================================================== --- trunk/libzypp/zypp/solver/detail/SATResolver.cc (original) +++ trunk/libzypp/zypp/solver/detail/SATResolver.cc Fri Aug 8 13:38:54 2008 @@ -80,7 +80,7 @@ ostringstream os; if (!item) return ""; - if (item->kind() != ResTraitszypp::Package::kind) + if (item->kind() != ResKind::package) os << item->kind() << ':'; os << item->name(); if (!shortVersion) { Modified: trunk/libzypp/zypp/target/rpm/RpmDb.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/target/rpm/RpmDb.cc?rev=10798&r1=10797&r2=10798&view=diff ============================================================================== --- trunk/libzypp/zypp/target/rpm/RpmDb.cc (original) +++ trunk/libzypp/zypp/target/rpm/RpmDb.cc Fri Aug 8 13:38:54 2008 @@ -1333,7 +1333,7 @@ { 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) { @@ -1426,7 +1426,7 @@ 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 -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org