Deprecate MediaAccess::downloads (accidentally deleted)
[platform/upstream/libzypp.git] / zypp / ResKind.cc
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file       zypp/ResKind.cc
10  *
11 */
12 #include <iostream>
13
14 #include "zypp/base/String.h"
15
16 #include "zypp/ResKind.h"
17 #include "zypp/ResTraits.h"
18
19 using std::endl;
20
21 ///////////////////////////////////////////////////////////////////
22 namespace zypp
23 { /////////////////////////////////////////////////////////////////
24
25   const ResKind ResKind::nokind;
26   const ResKind ResKind::package   ( "package" );
27   const ResKind ResKind::patch     ( "patch" );
28   const ResKind ResKind::pattern   ( "pattern" );
29   const ResKind ResKind::product   ( "product" );
30   const ResKind ResKind::srcpackage( "srcpackage" );
31
32   template<>
33     const ResKind ResTraits<Package>   ::kind( ResKind::package );
34   template<>
35     const ResKind ResTraits<Patch>     ::kind( ResKind::patch );
36   template<>
37     const ResKind ResTraits<Pattern>   ::kind( ResKind::pattern );
38   template<>
39     const ResKind ResTraits<Product>   ::kind( ResKind::product );
40   template<>
41     const ResKind ResTraits<SrcPackage>::kind( ResKind::srcpackage );
42
43   std::string ResKind::satIdent( const ResKind & refers_r, const std::string & name_r )
44   {
45     if ( ! refers_r || refers_r == package || refers_r == srcpackage )
46       return name_r;
47     return str::form( "%s:%s", refers_r.c_str(), name_r.c_str() );
48   }
49
50   /////////////////////////////////////////////////////////////////
51 } // namespace zypp
52 ///////////////////////////////////////////////////////////////////