libzypp: zypp/Capability.cc Source File

libzypp 17.25.10

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
25 #include <zypp/sat/detail/PoolImpl.h>
26 #include <zypp/sat/Pool.h>
27 #include <zypp/ResPool.h>
28
29 using std::endl;
30
32 namespace zypp
33 {
35 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
306 Capability::Capability( ResolverNamespace namespace_r, IdString value_r )
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
314 CapMatch Capability::_doMatch( sat::detail::IdType lhs, sat::detail::IdType rhs )
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;
327 case CapDetail::EXPRESSION:
328 return CapMatch::irrelevant;
329 break;
330 case CapDetail::NAMED:
331 case CapDetail::VERSIONED:
332 break;
333 }
334
335 switch ( r.kind() )
336 {
337 case CapDetail::NOCAP:
338 return CapMatch::no; // match case handled above
339 break;
340 case CapDetail::EXPRESSION:
341 return CapMatch::irrelevant;
342 break;
343 case CapDetail::NAMED:
344 case CapDetail::VERSIONED:
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/",
370 str::regex::nosubs );
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
455 void CapDetail::_init()
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;
526 case CapDetail::VERSIONED:
527 str << obj.name();
528 if ( obj.hasArch() )
529 str << archsep << obj.arch();
530 return str << " " << obj.op() << " " << obj.ed();
531 break;
532 case CapDetail::EXPRESSION:
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;
542 case CapDetail::CAP_NAMESPACE:
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
Arch.h
Capability.h
Edition.h
Exception.h
Gettext.h
Interface to gettext.
Logger.h
Pool.h
Regex.h
Rel.h
ResPool.h
String.h
zypp::Arch
Architecture.
Definition: Arch.h:37
zypp::CapDetail
Helper providing more detailed information about a Capability.
Definition: Capability.h:299
zypp::CapDetail::isNamed
bool isNamed() const
Definition: Capability.h:336
zypp::CapDetail::Kind
Kind
Definition: Capability.h:302
zypp::CapDetail::NAMED
@ NAMED
Definition: Capability.h:304
zypp::CapDetail::NOCAP
@ NOCAP
Definition: Capability.h:303
zypp::CapDetail::EXPRESSION
@ EXPRESSION
Definition: Capability.h:306
zypp::CapDetail::VERSIONED
@ VERSIONED
Definition: Capability.h:305
zypp::CapDetail::name
IdString name() const
Definition: Capability.h:345
zypp::CapDetail::hasArch
bool hasArch() const
Definition: Capability.h:343
zypp::CapDetail::arch
IdString arch() const
Definition: Capability.h:344
zypp::CapDetail::rhs
Capability rhs() const
Definition: Capability.h:354
zypp::CapDetail::ed
Edition ed() const
Definition: Capability.h:347
zypp::CapDetail::op
Rel op() const
Definition: Capability.h:346
zypp::CapDetail::_archIfSimple
sat::detail::IdType _archIfSimple
Definition: Capability.h:364
zypp::CapDetail::lhs
Capability lhs() const
Definition: Capability.h:352
zypp::CapDetail::kind
Kind kind() const
Definition: Capability.h:334
zypp::CapDetail::_init
void _init()
Definition: Capability.cc:455
zypp::CapDetail::_kind
Kind _kind
Definition: Capability.h:360
zypp::CapDetail::_rhs
sat::detail::IdType _rhs
Definition: Capability.h:362
zypp::CapDetail::capRel
CapRel capRel() const
Definition: Capability.h:353
zypp::CapDetail::_lhs
sat::detail::IdType _lhs
Definition: Capability.h:361
zypp::CapDetail::_flag
unsigned _flag
Definition: Capability.h:363
zypp::CapDetail::CapRel
CapRel
Enum values corresponding with libsolv defines.
Definition: Capability.h:313
zypp::CapDetail::CAP_OR
@ CAP_OR
Definition: Capability.h:316
zypp::CapDetail::REL_NONE
@ REL_NONE
Definition: Capability.h:314
zypp::CapDetail::CAP_AND
@ CAP_AND
Definition: Capability.h:315
zypp::CapDetail::CAP_ARCH
@ CAP_ARCH
Definition: Capability.h:319
zypp::CapDetail::CAP_NAMESPACE
@ CAP_NAMESPACE
Definition: Capability.h:318
zypp::CapDetail::CAP_WITH
@ CAP_WITH
Definition: Capability.h:317
zypp::CapMatch
Tri state Capability match result.
Definition: CapMatch.h:38
zypp::CapMatch::no
static const CapMatch no
Definition: CapMatch.h:52
zypp::CapMatch::irrelevant
static const CapMatch irrelevant
Definition: CapMatch.h:53
zypp::CapMatch::yes
static const CapMatch yes
Definition: CapMatch.h:51
zypp::Capability
A sat capability.
Definition: Capability.h:60
zypp::Capability::Null
static const Capability Null
No or Null Capability ( Id 0 ).
Definition: Capability.h:137
zypp::Capability::_id
sat::detail::IdType _id
Definition: Capability.h:259
zypp::Capability::Capability
Capability()
Default ctor, Empty capability.
Definition: Capability.h:66
zypp::Capability::detail
CapDetail detail() const
Helper providing more detailed information about a Capability.
Definition: Capability.h:379
zypp::Capability::c_str
const char * c_str() const
Conversion to const char *
Definition: Capability.cc:311
zypp::Capability::_doMatch
static CapMatch _doMatch(sat::detail::IdType lhs, sat::detail::IdType rhs)
Match two Capabilities.
Definition: Capability.cc:314
zypp::Capability::isInterestingFileSpec
static bool isInterestingFileSpec(const IdString &name_r)
Test for a filename that is likely being REQUIRED.
Definition: Capability.h:216
zypp::Capability::CtorFlag
CtorFlag
Definition: Capability.h:62
zypp::Capability::UNPARSED
@ UNPARSED
Definition: Capability.h:62
zypp::Capability::Empty
static const Capability Empty
Empty Capability.
Definition: Capability.h:140
zypp::Capability::guessPackageSpec
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
zypp::Edition
Edition represents [epoch:]version[-release]
Definition: Edition.h:61
zypp::Edition::noedition
static const Edition noedition
Value representing noedition ("") This is in fact a valid Edition.
Definition: Edition.h:73
zypp::IdString
Access to the sat-pools string space.
Definition: IdString.h:43
zypp::IdString::c_str
const char * c_str() const
Conversion to const char *
Definition: IdString.cc:50
zypp::IdString::empty
constexpr bool empty() const
Whether the string is empty.
Definition: IdString.h:87
zypp::IdString::id
IdType id() const
Expert backdoor.
Definition: IdString.h:122
zypp::IdString::asString
std::string asString() const
Conversion to std::string
Definition: IdString.h:98
zypp::ResKind
Resolvable kinds.
Definition: ResKind.h:33
zypp::ResKind::srcpackage
static const ResKind srcpackage
Definition: ResKind.h:44
zypp::ResPool
Global ResObject pool.
Definition: ResPool.h:61
zypp::ResPool::instance
static ResPool instance()
Singleton ctor.
Definition: ResPool.cc:37
zypp::ResPool::byIdentBegin
byIdent_iterator byIdentBegin(const ByIdent &ident_r) const
Definition: ResPool.h:166
zypp::ResPool::byIdentEnd
byIdent_iterator byIdentEnd(const ByIdent &ident_r) const
Definition: ResPool.h:197
zypp::sat::WhatProvides
Container of Solvable providing a Capability (read only).
Definition: WhatProvides.h:89
zypp::sat::WhatProvides::empty
bool empty() const
Whether the container is empty.
Definition: WhatProvides.cc:129
zypp::str::regex
Regular expression.
Definition: Regex.h:95
zypp::str::regex::nosubs
@ nosubs
Support for substring addressing of matches is not required.
Definition: Regex.h:100
zypp::str::smatch
Regular expression match result.
Definition: Regex.h:163
str
String related utilities and Regular expression matching.
zypp::sat::detail::emptyId
static const IdType emptyId(1)
zypp::sat::detail::noId
static const IdType noId(0)
zypp::sat::detail::size_type
SolvableIdType size_type
Definition: PoolMember.h:126
zypp::sat::detail::IdType
int IdType
Generic Id type.
Definition: PoolMember.h:104
zypp::sat::detail::CPool
::s_Pool CPool
Wrapped libsolv C data type exposed as backdoor.
Definition: PoolMember.h:61
zypp::str::hasPrefix
bool hasPrefix(const C_Str &str_r, const C_Str &prefix_r)
Return whether str_r has prefix prefix_r.
Definition: String.h:1023
zypp::str::regex_match
bool regex_match(const std::string &s, smatch &matches, const regex &regex)
\relates regex \ingroup ZYPP_STR_REGEX \relates regex \ingroup ZYPP_STR_REGEX
Definition: Regex.h:70
zypp::str::split
unsigned split(const C_Str &line_r, TOutputIterator result_r, const C_Str &sepchars_r=" \t", const Trim trim_r=NO_TRIM)
Split line_r into words.
Definition: String.h:527
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2
zypp::asString
std::string asString(const DefaultIntegral< Tp, TInitial > &obj)
Definition: DefaultIntegral.h:98
zypp::ResolverNamespace
ResolverNamespace
The resolvers dependency namespaces.
Definition: ResolverNamespace.h:25
zypp::overlaps
bool overlaps(const Range< Tp, TCompare > &lhs, const Range< Tp, TCompare > &rhs)
Definition: Range.h:65
zypp::operator<<
std::ostream & operator<<(std::ostream &str, const Exception &obj)
Definition: Exception.cc:147
zypp::Arch_empty
const Arch Arch_empty(IdString::Empty)
zypp::dumpOn
std::ostream & dumpOn(std::ostream &str, const Capability &obj)
Definition: Capability.cc:444
PoolImpl.h
zypp::Range
Definition: Range.h:35
zypp::Rel
Relational operators.
Definition: Rel.h:44
zypp::Rel::LT
static const Rel LT
Definition: Rel.h:52
zypp::Rel::GT
static const Rel GT
Definition: Rel.h:54
zypp::Rel::LE
static const Rel LE
Definition: Rel.h:53
zypp::Rel::GE
static const Rel GE
Definition: Rel.h:55
zypp::Rel::NE
static const Rel NE
Definition: Rel.h:51
zypp::Rel::ANY
static const Rel ANY
Definition: Rel.h:56
zypp::Rel::EQ
static const Rel EQ
Definition: Rel.h:50
zypp::Rel::isRel
static bool isRel(unsigned bits_r)
Test whether bits_r is a valid Rel (no extra bits set).
Definition: Rel.h:111
zypp::sat::detail::PoolMember::myPool
static PoolImpl & myPool()
Definition: PoolImpl.cc:178