SelectionImplIf.cc

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00012 #include "zypp/detail/SelectionImplIf.h"
00013 #include "zypp/ResTraits.h"
00014 #include <iostream>
00015 
00016 using namespace std;
00017 
00019 namespace zypp
00020 { 
00021 
00022   namespace detail
00023   { 
00024 
00026     // Default implementation of SelectionImplIf attributes,
00027     // as far as resonable.
00029 
00030     Label SelectionImplIf::category() const
00031     { return Label(); }
00032 
00033     bool SelectionImplIf::visible() const
00034     { return false; }
00035 
00036     Label SelectionImplIf::order() const
00037     { return Label(); }
00038 
00039     static void copycaps( std::set<std::string> & out, const CapSet & in)
00040     {
00041         for (CapSet::const_iterator it = in.begin(); it != in.end(); ++it) {
00042             if (isKind<capability::NamedCap>( *it )
00043                 && it->refers() == ResTraits<zypp::Package>::kind )
00044             {
00045                 out.insert( it->index() );
00046             }
00047         }
00048     }
00049 
00050     const std::set<std::string> SelectionImplIf::install_packages( const Locale & lang) const
00051     {
00052          std::set<std::string> result;
00053       #warning does not honor language packs
00054          copycaps( result, self()->dep( Dep::REQUIRES ) );
00055          copycaps( result, self()->dep( Dep::RECOMMENDS) );
00056 
00057          return result;
00058     }
00059 
00061   } // namespace detail
00064 } // namespace zypp

Generated on Thu Jul 6 00:07:20 2006 for zypp by  doxygen 1.4.6