1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/ui/PatternContentsImpl.cc
14 #include "zypp/base/LogTools.h"
16 #include "zypp/ui/PatternContentsImpl.h"
17 #include "zypp/ui/PatternExpander.h"
19 #include "zypp/ZYppFactory.h"
20 #include "zypp/ResPool.h"
24 ///////////////////////////////////////////////////////////////////
26 { /////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////
29 { /////////////////////////////////////////////////////////////////
31 ///////////////////////////////////////////////////////////////////
33 { /////////////////////////////////////////////////////////////////
35 struct CollectInstallPackages
37 CollectInstallPackages( std::set<std::string> & result )
41 void operator()( const Pattern::constPtr & pattern )
44 // std::set<std::string> s( pattern->install_packages() );
45 std::set<std::string> s;
46 _result->insert( s.begin(), s.end() );
49 std::set<std::string> * _result;
52 /////////////////////////////////////////////////////////////////
54 ///////////////////////////////////////////////////////////////////
56 PatternContents::Impl::Impl( const Pattern::constPtr & pattern )
60 std::set<std::string> PatternContents::Impl::install_packages() const
62 PatternExpander expander( getZYpp()->pool() );
64 if ( ! expander.expand( _pattern ) )
65 return std::set<std::string>(); // empty pattern set
67 std::set<std::string> result;
68 for_each( expander.begin(),
70 CollectInstallPackages( result ) );
74 /////////////////////////////////////////////////////////////////
76 ///////////////////////////////////////////////////////////////////
77 /////////////////////////////////////////////////////////////////
79 ///////////////////////////////////////////////////////////////////