libzypp  17.1.1
Capability.cc
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #include <iostream>
13 #include "zypp/base/Logger.h"
14 
15 #include "zypp/base/String.h"
16 #include "zypp/base/Regex.h"
17 #include "zypp/base/Gettext.h"
18 #include "zypp/base/Exception.h"
19 
20 #include "zypp/Arch.h"
21 #include "zypp/Rel.h"
22 #include "zypp/Edition.h"
23 #include "zypp/Capability.h"
24 
26 #include "zypp/sat/Pool.h"
27 #include "zypp/ResPool.h"
28 
29 using std::endl;
30 
32 namespace zypp
33 {
34  namespace
36  {
37 
39  inline std::string::size_type backskipWs( const std::string & str_r, std::string::size_type pos_r )
40  {
41  for ( ; pos_r != std::string::npos; --pos_r )
42  {
43  char ch = str_r[pos_r];
44  if ( ch != ' ' && ch != '\t' )
45  break;
46  }
47  return pos_r;
48  }
49 
51  inline std::string::size_type backskipNWs( const std::string & str_r, std::string::size_type pos_r )
52  {
53  for ( ; pos_r != std::string::npos; --pos_r )
54  {
55  char ch = str_r[pos_r];
56  if ( ch == ' ' || ch == '\t' )
57  break;
58  }
59  return pos_r;
60  }
61 
63  void splitOpEdition( std::string & str_r, Rel & op_r, Edition & ed_r )
64  {
65  if ( str_r.empty() )
66  return;
67  std::string::size_type ch( str_r.size()-1 );
68 
69  // check whether the one but last word is a valid Rel:
70  if ( (ch = backskipWs( str_r, ch )) != std::string::npos )
71  {
72  std::string::size_type ee( ch );
73  if ( (ch = backskipNWs( str_r, ch )) != std::string::npos )
74  {
75  std::string::size_type eb( ch );
76  if ( (ch = backskipWs( str_r, ch )) != std::string::npos )
77  {
78  std::string::size_type oe( ch );
79  ch = backskipNWs( str_r, ch ); // now before 'op'? begin
80  if ( op_r.parseFrom( str_r.substr( ch+1, oe-ch ) ) )
81  {
82  // found a legal 'op'
83  ed_r = Edition( str_r.substr( eb+1, ee-eb ) );
84  if ( ch != std::string::npos ) // 'op' is not at str_r begin, so skip WS
85  ch = backskipWs( str_r, ch );
86  str_r.erase( ch+1 );
87  return;
88  }
89  }
90  }
91  }
92  // HERE: Didn't find 'name op edition'
93  // As a convenience we check for an embeded 'op' (not surounded by WS).
94  // But just '[<=>]=?|!=' and not inside '()'.
95  ch = str_r.find_last_of( "<=>)" );
96  if ( ch != std::string::npos && str_r[ch] != ')' )
97  {
98  std::string::size_type oe( ch );
99 
100  // do edition first:
101  ch = str_r.find_first_not_of( " \t", oe+1 );
102  if ( ch != std::string::npos )
103  ed_r = Edition( str_r.substr( ch ) );
104 
105  // now finish op:
106  ch = oe-1;
107  if ( str_r[oe] != '=' ) // '[<>]'
108  {
109  op_r = ( str_r[oe] == '<' ) ? Rel::LT : Rel::GT;
110  }
111  else
112  { // '?='
113  if ( ch != std::string::npos )
114  {
115  switch ( str_r[ch] )
116  {
117  case '<': --ch; op_r = Rel::LE; break;
118  case '>': --ch; op_r = Rel::GE; break;
119  case '!': --ch; op_r = Rel::NE; break;
120  case '=': --ch; // fall through
121  default: op_r = Rel::EQ; break;
122  }
123  }
124  }
125 
126  // finally name:
127  if ( ch != std::string::npos ) // 'op' is not at str_r begin, so skip WS
128  ch = backskipWs( str_r, ch );
129  str_r.erase( ch+1 );
130  return;
131  }
132  // HERE: It's a plain 'name'
133  }
134 
137  sat::detail::IdType relFromStr( sat::detail::CPool * pool_r,
138  const Arch & arch_r,
139  const std::string & name_r,
140  Rel op_r,
141  const Edition & ed_r,
142  const ResKind & kind_r )
143  {
144  // First build the name, non-packages prefixed by kind
145  sat::Solvable::SplitIdent split( kind_r, name_r );
146  sat::detail::IdType nid( split.ident().id() );
147 
148  if ( split.kind() == ResKind::srcpackage )
149  {
150  // map 'kind srcpackage' to 'arch src', the pseudo architecture
151  // libsolv uses.
152  nid = ::pool_rel2id( pool_r, nid, IdString(ARCH_SRC).id(), REL_ARCH, /*create*/true );
153  }
154 
155  // Extend name by architecture, if provided and not a srcpackage
156  if ( ! arch_r.empty() && kind_r != ResKind::srcpackage )
157  {
158  nid = ::pool_rel2id( pool_r, nid, arch_r.id(), REL_ARCH, /*create*/true );
159  }
160 
161  // Extend 'op edition', if provided
162  if ( op_r != Rel::ANY && ed_r != Edition::noedition )
163  {
164  nid = ::pool_rel2id( pool_r, nid, ed_r.id(), op_r.bits(), /*create*/true );
165  }
166 
167  return nid;
168  }
169 
173  sat::detail::IdType relFromStr( sat::detail::CPool * pool_r,
174  const std::string & name_r, Rel op_r, const Edition & ed_r,
175  const ResKind & kind_r )
176  {
177  static const Arch srcArch( IdString(ARCH_SRC).asString() );
178  static const std::string srcKindPrefix( ResKind::srcpackage.asString() + ':' );
179 
180  // check for an embedded 'srcpackage:foo' to be mapped to 'foo' and 'ResKind::srcpackage'.
181  if ( kind_r.empty() && str::hasPrefix( name_r, srcKindPrefix ) )
182  {
183  return relFromStr( pool_r, Arch_empty, name_r.substr( srcKindPrefix.size() ), op_r, ed_r, ResKind::srcpackage );
184  }
185 
186  Arch arch( Arch_empty );
187  std::string name( name_r );
188 
189  std::string::size_type asep( name_r.rfind( "." ) );
190  if ( asep != std::string::npos )
191  {
192  Arch ext( name_r.substr( asep+1 ) );
193  if ( ext.isBuiltIn() || ext == srcArch )
194  {
195  arch = ext;
196  name.erase( asep );
197  }
198  }
199 
200  return relFromStr( pool_r, arch, name, op_r, ed_r, kind_r );
201  }
202 
205  sat::detail::IdType relFromStr( sat::detail::CPool * pool_r,
206  const Arch & arch_r, // parse from name if empty
207  const std::string & str_r, const ResKind & kind_r,
208  Capability::CtorFlag flag_r )
209  {
210  std::string name( str_r );
211  Rel op;
212  Edition ed;
213  if ( flag_r == Capability::UNPARSED )
214  {
215  splitOpEdition( name, op, ed );
216  }
217 
218  if ( arch_r.empty() )
219  return relFromStr( pool_r, name, op, ed, kind_r ); // parses for name[.arch]
220  // else
221  return relFromStr( pool_r, arch_r, name, op, ed, kind_r );
222  }
223 
225  } // namespace
227 
228  const Capability Capability::Null( STRID_NULL );
229  const Capability Capability::Empty( STRID_EMPTY );
230 
232 
233  Capability::Capability( const char * str_r, const ResKind & prefix_r, CtorFlag flag_r )
234  : _id( relFromStr( myPool().getPool(), Arch_empty, str_r, prefix_r, flag_r ) )
235  {}
236 
237  Capability::Capability( const std::string & str_r, const ResKind & prefix_r, CtorFlag flag_r )
238  : _id( relFromStr( myPool().getPool(), Arch_empty, str_r.c_str(), prefix_r, flag_r ) )
239  {}
240 
241  Capability::Capability( const Arch & arch_r, const char * str_r, const ResKind & prefix_r, CtorFlag flag_r )
242  : _id( relFromStr( myPool().getPool(), arch_r, str_r, prefix_r, flag_r ) )
243  {}
244 
245  Capability::Capability( const Arch & arch_r, const std::string & str_r, const ResKind & prefix_r, CtorFlag flag_r )
246  : _id( relFromStr( myPool().getPool(), arch_r, str_r.c_str(), prefix_r, flag_r ) )
247  {}
248 
249  Capability::Capability( const char * str_r, CtorFlag flag_r, const ResKind & prefix_r )
250  : _id( relFromStr( myPool().getPool(), Arch_empty, str_r, prefix_r, flag_r ) )
251  {}
252 
253  Capability::Capability( const std::string & str_r, CtorFlag flag_r, const ResKind & prefix_r )
254  : _id( relFromStr( myPool().getPool(), Arch_empty, str_r, prefix_r, flag_r ) )
255  {}
256 
257  Capability::Capability( const Arch & arch_r, const char * str_r, CtorFlag flag_r, const ResKind & prefix_r )
258  : _id( relFromStr( myPool().getPool(), arch_r, str_r, prefix_r, flag_r ) )
259  {}
260 
261  Capability::Capability( const Arch & arch_r, const std::string & str_r, CtorFlag flag_r, const ResKind & prefix_r )
262  : _id( relFromStr( myPool().getPool(), arch_r, str_r, prefix_r, flag_r ) )
263  {}
264 
266  // Ctor from <name[.arch] op edition>.
268 
269  Capability::Capability( const std::string & name_r, const std::string & op_r, const std::string & ed_r, const ResKind & prefix_r )
270  : _id( relFromStr( myPool().getPool(), name_r, Rel(op_r), Edition(ed_r), prefix_r ) )
271  {}
272  Capability::Capability( const std::string & name_r, Rel op_r, const std::string & ed_r, const ResKind & prefix_r )
273  : _id( relFromStr( myPool().getPool(), name_r, op_r, Edition(ed_r), prefix_r ) )
274  {}
275  Capability::Capability( const std::string & name_r, Rel op_r, const Edition & ed_r, const ResKind & prefix_r )
276  : _id( relFromStr( myPool().getPool(), name_r, op_r, ed_r, prefix_r ) )
277  {}
278 
280  // Ctor from <arch name op edition>.
282 
283  Capability::Capability( const std::string & arch_r, const std::string & name_r, const std::string & op_r, const std::string & ed_r, const ResKind & prefix_r )
284  : _id( relFromStr( myPool().getPool(), Arch(arch_r), name_r, Rel(op_r), Edition(ed_r), prefix_r ) )
285  {}
286  Capability::Capability( const std::string & arch_r, const std::string & name_r, Rel op_r, const std::string & ed_r, const ResKind & prefix_r )
287  : _id( relFromStr( myPool().getPool(), Arch(arch_r), name_r, op_r, Edition(ed_r), prefix_r ) )
288  {}
289  Capability::Capability( const std::string & arch_r, const std::string & name_r, Rel op_r, const Edition & ed_r, const ResKind & prefix_r )
290  : _id( relFromStr( myPool().getPool(), Arch(arch_r), name_r, op_r, ed_r, prefix_r ) )
291  {}
292  Capability::Capability( const Arch & arch_r, const std::string & name_r, const std::string & op_r, const std::string & ed_r, const ResKind & prefix_r )
293  : _id( relFromStr( myPool().getPool(), arch_r, name_r, Rel(op_r), Edition(ed_r), prefix_r ) )
294  {}
295  Capability::Capability( const Arch & arch_r, const std::string & name_r, Rel op_r, const std::string & ed_r, const ResKind & prefix_r )
296  : _id( relFromStr( myPool().getPool(), arch_r, name_r, op_r, Edition(ed_r), prefix_r ) )
297  {}
298  Capability::Capability( const Arch & arch_r, const std::string & name_r, Rel op_r, const Edition & ed_r, const ResKind & prefix_r )
299  : _id( relFromStr( myPool().getPool(), arch_r, name_r, op_r, ed_r, prefix_r ) )
300  {}
301 
303  // Ctor creating a namespace: capability.
305 
307  : _id( ::pool_rel2id( myPool().getPool(), asIdString(namespace_r).id(), (value_r.empty() ? STRID_NULL : value_r.id() ), REL_NAMESPACE, /*create*/true ) )
308  {}
309 
310 
311  const char * Capability::c_str() const
312  { return( _id ? ::pool_dep2str( myPool().getPool(), _id ) : "" ); }
313 
315  {
316  if ( lhs == rhs )
317  return CapMatch::yes;
318 
319  CapDetail l( lhs );
320  CapDetail r( rhs );
321 
322  switch ( l.kind() )
323  {
324  case CapDetail::NOCAP:
325  return( r.kind() == CapDetail::NOCAP ); // NOCAP matches NOCAP only
326  break;
328  return CapMatch::irrelevant;
329  break;
330  case CapDetail::NAMED:
332  break;
333  }
334 
335  switch ( r.kind() )
336  {
337  case CapDetail::NOCAP:
338  return CapMatch::no; // match case handled above
339  break;
341  return CapMatch::irrelevant;
342  break;
343  case CapDetail::NAMED:
345  break;
346  }
347  // comparing two simple caps:
348  if ( l.name() != r.name() )
349  return CapMatch::no;
350 
351  // if both are arch restricted they must match
352  if ( l.arch() != r.arch()
353  && ! ( l.arch().empty() || r.arch().empty() ) )
354  return CapMatch::no;
355 
356  // isNamed matches ANY edition:
357  if ( l.isNamed() || r.isNamed() )
358  return CapMatch::yes;
359 
360  // both are versioned:
361  return overlaps( Edition::MatchRange( l.op(), l.ed() ),
362  Edition::MatchRange( r.op(), r.ed() ) );
363  }
364 
365  bool Capability::isInterestingFileSpec( const char * name_r )
366  {
367  static str::smatch what;
368  static const str::regex filenameRegex(
369  "/(s?bin|lib(64)?|etc)/|^/usr/(games/|share/(dict/words|magic\\.mime)$)|^/opt/gnome/games/",
371 
372  return str::regex_match( name_r, what, filenameRegex );
373  }
374 
375  Capability Capability::guessPackageSpec( const std::string & str_r, bool & rewrote_r )
376  {
377  Capability cap( str_r );
378  CapDetail detail( cap.detail() );
379 
380  // str_r might be the form "libzypp-1.2.3-4.5(.arch)'
381  // correctly parsed as name capability by the ctor.
382  // TODO: Think about allowing glob char in name - for now don't process
383  if ( detail.isNamed() && !::strpbrk( detail.name().c_str(), "*?[{" )
384  && ::strrchr( detail.name().c_str(), '-' ) && sat::WhatProvides( cap ).empty() )
385  {
386  Arch origArch( detail.arch() ); // to support a trailing .arch
387 
388  std::string guess( detail.name().asString() );
389  std::string::size_type pos( guess.rfind( '-' ) );
390  guess[pos] = '=';
391 
392  Capability guesscap( origArch, guess );
393  detail = guesscap.detail();
394 
395  ResPool pool( ResPool::instance() );
396  // require name part matching a pool items name (not just provides!)
397  if ( pool.byIdentBegin( detail.name() ) != pool.byIdentEnd( detail.name() ) )
398  {
399  rewrote_r = true;
400  return guesscap;
401  }
402 
403  // try the one but last '-'
404  if ( pos )
405  {
406  guess[pos] = '-';
407  if ( (pos = guess.rfind( '-', pos-1 )) != std::string::npos )
408  {
409  guess[pos] = '=';
410 
411  guesscap = Capability( origArch, guess );
412  detail = guesscap.detail();
413 
414  // require name part matching a pool items name (not just provides!)
415  if ( pool.byIdentBegin( detail.name() ) != pool.byIdentEnd( detail.name() ) )
416  {
417  rewrote_r = true;
418  return guesscap;
419  }
420  }
421  }
422  }
423 
424  rewrote_r = false;
425  return cap;
426  }
427 
428  Capability Capability::guessPackageSpec( const std::string & str_r )
429  {
430  bool dummy;
431  return guessPackageSpec( str_r, dummy );
432  }
433 
434  /******************************************************************
435  **
436  ** FUNCTION NAME : operator<<
437  ** FUNCTION TYPE : std::ostream &
438  */
439  std::ostream & operator<<( std::ostream & str, const Capability & obj )
440  {
441  return str << obj.detail();
442  }
443 
444  std::ostream & dumpOn( std::ostream & str, const Capability & obj )
445  {
446  return str << obj.detail();
447  }
448 
450  //
451  // CLASS NAME : CapDetail
452  //
454 
456  {
457  // : _kind( NOCAP ), _lhs( id_r ), _rhs( 0 ), _flag( 0 ), _archIfSimple( 0 )
458 
459  if ( _lhs == sat::detail::emptyId || _lhs == sat::detail::noId )
460  return; // NOCAP
461 
462  if ( ! ISRELDEP(_lhs) )
463  {
464  // this is name without arch!
465  _kind = NAMED;
466  return;
467  }
468 
469  ::Reldep * rd = GETRELDEP( myPool().getPool(), _lhs );
470  _lhs = rd->name;
471  _rhs = rd->evr;
472  _flag = rd->flags;
473 
474  if ( Rel::isRel( _flag ) )
475  {
476  _kind = VERSIONED;
477  // Check for name.arch...
478  if ( ! ISRELDEP(_lhs) )
479  return; // this is name without arch!
480  rd = GETRELDEP( myPool().getPool(), _lhs );
481  if ( rd->flags != CAP_ARCH )
482  return; // this is not name.arch
483  // This is name.arch:
484  _lhs = rd->name;
485  _archIfSimple = rd->evr;
486  }
487  else if ( rd->flags == CAP_ARCH )
488  {
489  _kind = NAMED;
490  // This is name.arch:
491  _lhs = rd->name;
492  _archIfSimple = rd->evr;
493  }
494  else
495  {
496  _kind = EXPRESSION;
497  return;
498  }
499  // map back libsolvs pseudo arch 'src' to kind srcpackage
500  if ( _archIfSimple == ARCH_SRC )
501  {
502  _lhs = IdString( (ResKind::srcpackage.asString() + ":" + IdString(_lhs).c_str()).c_str() ).id();
503  _archIfSimple = 0;
504  }
505  }
506 
507  /******************************************************************
508  **
509  ** FUNCTION NAME : operator<<
510  ** FUNCTION TYPE : std::ostream &
511  */
512  std::ostream & operator<<( std::ostream & str, const CapDetail & obj )
513  {
514  static const char archsep = '.';
515  switch ( obj.kind() )
516  {
517  case CapDetail::NOCAP:
518  return str << "<NoCap>";
519  break;
520  case CapDetail::NAMED:
521  str << obj.name();
522  if ( obj.hasArch() )
523  str << archsep << obj.arch();
524  return str;
525  break;
527  str << obj.name();
528  if ( obj.hasArch() )
529  str << archsep << obj.arch();
530  return str << " " << obj.op() << " " << obj.ed();
531  break;
533  switch ( obj.capRel() )
534  {
535  case CapDetail::REL_NONE:
536  case CapDetail::CAP_AND:
537  case CapDetail::CAP_OR:
538  case CapDetail::CAP_WITH:
539  case CapDetail::CAP_ARCH:
540  return str << obj.lhs().detail() << " " << obj.capRel() << " " << obj.rhs().detail();
541  break;
543  return str << obj.lhs().detail() << "(" << obj.rhs().detail() << ")";
544  }
545  break;
546  }
547  return str << "<UnknownCap>";
548  }
549 
550  std::ostream & operator<<( std::ostream & str, CapDetail::Kind obj )
551  {
552  switch ( obj )
553  {
554  case CapDetail::NOCAP: return str << "NoCap"; break;
555  case CapDetail::NAMED: return str << "NamedCap"; break;
556  case CapDetail::VERSIONED: return str << "VersionedCap"; break;
557  case CapDetail::EXPRESSION: return str << "CapExpression"; break;
558  }
559  return str << "UnknownCap";
560  }
561 
562  std::ostream & operator<<( std::ostream & str, CapDetail::CapRel obj )
563  {
564  switch ( obj )
565  {
566  case CapDetail::REL_NONE: return str << "NoCapRel"; break;
567  case CapDetail::CAP_AND: return str << "&"; break; // AND
568  case CapDetail::CAP_OR: return str << "|"; break; // OR
569  case CapDetail::CAP_WITH: return str << "+"; break; // WITH
570  case CapDetail::CAP_NAMESPACE: return str << "NAMESPACE"; break;
571  case CapDetail::CAP_ARCH: return str << "ARCH"; break;
572  }
573  return str << "UnknownCapRel";
574  }
575 
577 } // namespace zypp
Interface to gettext.
static const Rel NE
Definition: Rel.h:51
static const Rel LT
Definition: Rel.h:52
CapRel capRel() const
Definition: Capability.h:353
int IdType
Generic Id type.
Definition: PoolMember.h:104
static const Rel GT
Definition: Rel.h:54
Container of Solvable providing a Capability (read only).
Definition: WhatProvides.h:87
Capability lhs() const
Definition: Capability.h:352
std::string asString(const DefaultIntegral< Tp, TInitial > &obj)
Regular expression.
Definition: Regex.h:86
Edition ed() const
Definition: Capability.h:347
bool empty() const
Whether the container is empty.
static CapMatch _doMatch(sat::detail::IdType lhs, sat::detail::IdType rhs)
Match two Capabilities.
Definition: Capability.cc:314
static Capability guessPackageSpec(const std::string &str_r)
Capability parser also guessing "libzypp-1.2.3-4.5.x86_64" formats.
Definition: Capability.cc:428
Helper providing more detailed information about a Capability.
Definition: Capability.h:298
Architecture.
Definition: Arch.h:36
Relational operators.
Definition: Rel.h:43
static const CapMatch no
Definition: CapMatch.h:52
static const Rel EQ
Definition: Rel.h:50
IdType id() const
Expert backdoor.
Definition: IdString.h:115
bool isNamed() const
Definition: Capability.h:336
::_Pool CPool
Wrapped libsolv C data type exposed as backdoor.
Definition: PoolMember.h:61
const Arch Arch_empty(IdString::Empty)
String related utilities and Regular expression matching.
static const Rel LE
Definition: Rel.h:53
static const ResKind srcpackage
Definition: ResKind.h:44
Access to the sat-pools string space.
Definition: IdString.h:41
Rel op() const
Definition: Capability.h:346
unsigned split(const C_Str &line_r, TOutputIterator result_r, const C_Str &sepchars_r=" \)
Split line_r into words.
Definition: String.h:519
Edition represents [epoch:]version[-release]
Definition: Edition.h:60
static const Rel ANY
Definition: Rel.h:56
static bool isInterestingFileSpec(const IdString &name_r)
Test for a filename that is likely being REQUIRED.
Definition: Capability.h:216
IdString arch() const
Definition: Capability.h:344
Support for substring addressing of matches is not required.
Definition: Regex.h:92
sat::detail::IdType id() const
Expert backdoor.
Definition: Capability.h:253
ResolverNamespace
The resolvers dependency namespaces.
std::ostream & dumpOn(std::ostream &str, const Capability &obj)
Definition: Capability.cc:444
static const CapMatch irrelevant
Definition: CapMatch.h:53
constexpr bool empty() const
Whether the string is empty.
Definition: IdString.h:80
static const IdType emptyId(1)
static bool isRel(unsigned bits_r)
Test whether bits_r is a valid Rel (no extra bits set).
Definition: Rel.h:111
static const Rel GE
Definition: Rel.h:55
static PoolImpl & myPool()
Definition: PoolImpl.cc:172
const char * c_str() const
Conversion to const char *
Definition: IdString.cc:50
Tri state Capability match result.
Definition: CapMatch.h:37
static const Capability Null
No or Null Capability ( Id 0 ).
Definition: Capability.h:137
Kind kind() const
Definition: Capability.h:334
std::ostream & operator<<(std::ostream &str, const Capability &obj)
Definition: Capability.cc:439
SolvableIdType size_type
Definition: PoolMember.h:126
Regular expression match result.
Definition: Regex.h:145
Global ResObject pool.
Definition: ResPool.h:60
A sat capability.
Definition: Capability.h:59
static const IdType noId(0)
sat::detail::IdType _id
Definition: Capability.h:259
static const Capability Empty
Empty Capability.
Definition: Capability.h:140
Capability()
Default ctor, Empty capability.
Definition: Capability.h:66
bool regex_match(const std::string &s, smatch &matches, const regex &regex)
regex ZYPP_STR_REGEX regex ZYPP_STR_REGEX
Definition: Regex.h:70
byIdent_iterator byIdentEnd(const ByIdent &ident_r) const
Definition: ResPool.h:197
std::string asString() const
Conversion to std::string
Definition: IdString.h:91
CapRel
Enum values corresponding with libsolv defines.
Definition: Capability.h:312
static const CapMatch yes
Definition: CapMatch.h:51
bool overlaps(const Range< Tp, TCompare > &lhs, const Range< Tp, TCompare > &rhs)
Definition: Range.h:65
Capability rhs() const
Definition: Capability.h:354
CapDetail detail() const
Helper providing more detailed information about a Capability.
Definition: Capability.h:379
bool hasArch() const
Definition: Capability.h:343
std::string asString() const
Definition: Capability.h:158
Resolvable kinds.
Definition: ResKind.h:32
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1
bool empty() const
Whether the Capability is empty.
Definition: Capability.h:150
IdString name() const
Definition: Capability.h:345
bool hasPrefix(const C_Str &str_r, const C_Str &prefix_r)
Return whether str_r has prefix prefix_r.
Definition: String.h:1028
byIdent_iterator byIdentBegin(const ByIdent &ident_r) const
Definition: ResPool.h:166
static const Edition noedition
Value representing noedition ("") This is in fact a valid Edition.
Definition: Edition.h:73
const char * c_str() const
Conversion to const char *
Definition: Capability.cc:311
static ResPool instance()
Singleton ctor.
Definition: ResPool.cc:33