libzypp  13.10.6
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
static const ResKind package
Definition: ResKind.h:43
static const ResKind kind
Definition: ResTraits.h:83
static const ResKind srcpackage
Definition: ResKind.h:47
static std::string satIdent(const ResKind &refers_r, const std::string &name_r)
Return libsolv identifier for name.
Definition: ResKind.cc:43
static const ResKind pattern
Definition: ResKind.h:45
std::string form(const char *format,...)
Printf style construction of std::string.
Definition: String.cc:34
const char * c_str() const
Definition: IdStringType.h:105
static const ResKind nokind
Value representing nokind (&quot;&quot;)
Definition: ResKind.h:41
static const ResKind product
Definition: ResKind.h:46
Resolvable kinds.
Definition: ResKind.h:35
static const ResKind patch
Definition: ResKind.h:44