00001 /*---------------------------------------------------------------------\ 00002 | ____ _ __ __ ___ | 00003 | |__ / \ / / . \ . \ | 00004 | / / \ V /| _/ _/ | 00005 | / /__ | | | | | | | 00006 | /_____||_| |_| |_| | 00007 | | 00008 \---------------------------------------------------------------------*/ 00012 #include "zypp/capability/NamedCap.h" 00013 00014 using namespace std; 00015 00017 namespace zypp 00018 { 00019 00020 namespace capability 00021 { 00022 00023 IMPL_PTR_TYPE(NamedCap) 00024 00025 const CapabilityImpl::Kind & NamedCap::kind() const 00026 { return CapTraits<Self>::kind; } 00027 00028 CapMatch NamedCap::matches( const CapabilityImpl::constPtr & rhs ) const 00029 { 00030 if ( sameKindAndRefers( rhs ) ) 00031 { 00032 intrusive_ptr<const Self> namedrhs( asKind<Self>(rhs) ); 00033 return( _name == namedrhs->_name 00034 && range().overlaps( namedrhs->range() ) ); 00035 } 00036 return false; 00037 } 00038 00039 std::string NamedCap::encode() const 00040 { return _name; } 00041 00042 const Edition::MatchRange & NamedCap::range() const 00043 { 00044 static Edition::MatchRange _range; 00045 return _range; 00046 } 00047 00049 } // namespace capability 00052 } // namespace zypp
1.5.3