00001 /*---------------------------------------------------------------------\ 00002 | ____ _ __ __ ___ | 00003 | |__ / \ / / . \ . \ | 00004 | / / \ V /| _/ _/ | 00005 | / /__ | | | | | | | 00006 | /_____||_| |_| |_| | 00007 | | 00008 \---------------------------------------------------------------------*/ 00013 #include "zypp/detail/PatternImplIf.h" 00014 00016 namespace zypp 00017 { 00018 00020 namespace detail 00021 { 00022 00023 bool PatternImplIf::isDefault() const 00024 { return false; } 00025 00026 bool PatternImplIf::userVisible() const 00027 { return true; } 00028 00029 TranslatedText PatternImplIf::category() const 00030 { return TranslatedText(); } 00031 00032 Pathname PatternImplIf::icon() const 00033 { return Pathname(); } 00034 00035 Pathname PatternImplIf::script() const 00036 { return Pathname(); } 00037 00038 Label PatternImplIf::order() const 00039 { return Label(); } 00040 00041 static void copycaps( std::set<std::string> & out, const CapSet & in) 00042 { 00043 for (CapSet::const_iterator it = in.begin(); it != in.end(); ++it) { 00044 if (isKind<capability::NamedCap>( *it ) 00045 && it->refers() == ResTraits<zypp::Package>::kind ) 00046 { 00047 out.insert( it->index() ); 00048 } 00049 } 00050 } 00051 00052 std::set<std::string> PatternImplIf::install_packages( const Locale & lang) const 00053 { 00054 std::set<std::string> result; 00055 00056 copycaps( result, self()->dep( Dep::REQUIRES ) ); 00057 copycaps( result, self()->dep( Dep::RECOMMENDS) ); 00058 00059 return result; 00060 } 00061 00063 } // namespace detail 00066 } // namespace zypp