libzypp  17.38.7
capabilities.cc
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
13 #include "capabilities.h"
14 
15 #include <iostream>
17 
18 using std::endl;
19 
20 namespace zyppng::sat
21 {
23  : _begin( base_r )
24  {
25  if ( ! _begin )
26  return;
27 
28  if ( skip_r )
29  {
30  for ( const sat::detail::IdType * end = _begin; *end; ++end )
31  {
32  if ( *end == skip_r )
33  {
34  _begin = end+1;
35  return;
36  }
37  }
38  }
39  // skipp all ==> empty
40  _begin = 0;
41  }
42 
43 
45  {
46  if ( ! _begin )
47  return 0;
48 
49  // jump over libsolvs internal ids.
51  for ( const sat::detail::IdType * end = _begin; *end; ++end )
52  {
53  if ( ! sat::detail::isDepMarkerId( *end ) )
54  ++ret;
55  }
56  return ret;
57  }
58 } // namespace zyppng::sat
59 
This file contains private API, this might break at any time between releases.
Definition: capabilities.h:22
zypp::sat::detail::IdType IdType
Definition: poolconstants.h:43
bool isDepMarkerId(IdType id_r)
Test for internal ids satlib includes in dependencies.
Definition: PoolDefines.h:57
Capabilities()
Default ctor.
Definition: capabilities.h:42
const_iterator end() const
Iterator pointing behind the last Capability.
Definition: capabilities.h:182
size_type size() const
Number of capabilities inside.
Definition: capabilities.cc:44
const sat::detail::IdType * _begin
Definition: capabilities.h:85