libzypp  12.16.5
ResKind.cc
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
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 
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<>
34  template<>
35  const ResKind ResTraits<Patch> ::kind( ResKind::patch );
36  template<>
38  template<>
40  template<>
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 
51 } // namespace zypp