backup while cleaning up
[platform/upstream/libzypp.git] / zypp / Pattern.cc
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file       zypp/Pattern.cc
10  *
11 */
12 #include <iostream>
13
14 #include "zypp/Pattern.h"
15
16 ///////////////////////////////////////////////////////////////////
17 namespace zypp
18 { /////////////////////////////////////////////////////////////////
19
20   IMPL_PTR_TYPE(Pattern);
21
22   ///////////////////////////////////////////////////////////////////
23   //
24   //    METHOD NAME : Pattern::Pattern
25   //    METHOD TYPE : Ctor
26   //
27   Pattern::Pattern( const sat::Solvable & solvable_r )
28   : ResObject( solvable_r )
29   {}
30
31   ///////////////////////////////////////////////////////////////////
32   //
33   //    METHOD NAME : Pattern::~Pattern
34   //    METHOD TYPE : Dtor
35   //
36   Pattern::~Pattern()
37   {}
38
39   ///////////////////////////////////////////////////////////////////
40   //
41   //    Pattern interface forwarded to implementation
42   //
43   ///////////////////////////////////////////////////////////////////
44   /** */
45   bool Pattern::isDefault() const
46   { return lookupBoolAttribute( sat::SolvAttr::isdefault ); }
47   /** */
48   bool Pattern::userVisible() const
49   { return lookupBoolAttribute( sat::SolvAttr::isvisible ); }
50   /** */
51   std::string Pattern::category( const Locale & lang_r ) const
52   { return lookupStrAttribute( sat::SolvAttr::category, lang_r ); }
53   /** */
54   Pathname Pattern::icon() const
55   { return lookupStrAttribute( sat::SolvAttr::icon ); }
56   /** */
57   Pathname Pattern::script() const
58   { return lookupStrAttribute( sat::SolvAttr::script ); }
59
60   std::string Pattern::order() const
61   { return lookupStrAttribute( sat::SolvAttr::order ); }
62
63 #warning implement PATTERN::INSTALL_PACKAGES
64 #if 0
65   std::set<std::string> Pattern::install_packages( const Locale & lang ) const
66   {
67 -    static void copycaps( std::set<std::string> & out, const CapSet & in)
68 -    {
69 -       for (CapSet::const_iterator it = in.begin(); it != in.end(); ++it) {
70 -           if (isKind<capability::NamedCap>( *it )
71 -               && it->refers() == ResTraits<zypp::Package>::kind )
72 -           {
73 -               out.insert( it->index() );
74 -           }
75 -       }
76 -    }
77 -
78 -    std::set<std::string> PatternImplIf::install_packages( const Locale & lang) const
79 -    {
80 -       std::set<std::string> result;
81 -
82 -       copycaps( result, self()->dep( Dep::REQUIRES ) );
83 -       copycaps( result, self()->dep( Dep::RECOMMENDS) );
84 -       copycaps( result, self()->dep( Dep::SUGGESTS) );
85 -
86 -       return result;
87 -    }
88 -
89 -
90   return std::set<std::string>();
91   }
92 #endif
93
94 #warning implement PATTERN::INSTALL_PACKAGES
95  const Capabilities & Pattern::includes() const
96   {
97     static Capabilities _val;
98     return _val;
99   }
100
101   const Capabilities & Pattern::extends() const
102   {
103     static Capabilities _val;
104     return _val;
105   }
106
107
108   /////////////////////////////////////////////////////////////////
109 } // namespace zypp
110 ///////////////////////////////////////////////////////////////////