41 for ( ; pos_r != std::string::npos; --pos_r )
43 char ch = str_r[pos_r];
44 if ( ch !=
' ' && ch !=
'\t' )
53 for ( ; pos_r != std::string::npos; --pos_r )
55 char ch = str_r[pos_r];
56 if ( ch ==
' ' || ch ==
'\t' )
63 void splitOpEdition( std::string & str_r, Rel & op_r, Edition & ed_r )
70 if ( (ch = backskipWs( str_r, ch )) != std::string::npos )
73 if ( (ch = backskipNWs( str_r, ch )) != std::string::npos )
76 if ( (ch = backskipWs( str_r, ch )) != std::string::npos )
79 ch = backskipNWs( str_r, ch );
80 if ( op_r.parseFrom( str_r.substr( ch+1, oe-ch ) ) )
83 ed_r = Edition( str_r.substr( eb+1, ee-eb ) );
84 if ( ch != std::string::npos )
85 ch = backskipWs( str_r, ch );
95 ch = str_r.find_last_of(
"<=>)" );
96 if ( ch != std::string::npos && str_r[ch] !=
')' )
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 ) );
107 if ( str_r[oe] !=
'=' )
113 if ( ch != std::string::npos )
117 case '<': --ch; op_r =
Rel::LE;
break;
118 case '>': --ch; op_r =
Rel::GE;
break;
119 case '!': --ch; op_r =
Rel::NE;
break;
121 default: op_r =
Rel::EQ;
break;
127 if ( ch != std::string::npos )
128 ch = backskipWs( str_r, ch );
139 const std::string & name_r,
141 const Edition & ed_r,
142 const ResKind & kind_r )
145 sat::Solvable::SplitIdent
split( kind_r, name_r );
152 nid = ::pool_rel2id( pool_r, nid, IdString(ARCH_SRC).
id(), REL_ARCH,
true );
158 nid = ::pool_rel2id( pool_r, nid, arch_r.id(), REL_ARCH,
true );
164 nid = ::pool_rel2id( pool_r, nid, ed_r.id(), op_r.bits(),
true );
174 const std::string & name_r, Rel op_r,
const Edition & ed_r,
175 const ResKind & kind_r )
177 static const Arch srcArch( IdString(ARCH_SRC).
asString() );
187 std::string name( name_r );
190 if ( asep != std::string::npos )
192 Arch ext( name_r.substr( asep+1 ) );
193 if ( ext.isBuiltIn() || ext == srcArch )
200 return relFromStr( pool_r, arch, name, op_r, ed_r, kind_r );
207 const std::string & str_r,
const ResKind & kind_r,
210 std::string name( str_r );
215 splitOpEdition( name, op, ed );
218 if ( arch_r.empty() )
219 return relFromStr( pool_r, name, op, ed, kind_r );
221 return relFromStr( pool_r, arch_r, name, op, ed, kind_r );
234 : _id( relFromStr( myPool().getPool(),
Arch_empty, str_r, prefix_r, flag_r ) )
238 : _id( relFromStr( myPool().getPool(),
Arch_empty, str_r.c_str(), prefix_r, flag_r ) )
242 : _id( relFromStr( myPool().getPool(), arch_r, str_r, prefix_r, flag_r ) )
246 : _id( relFromStr( myPool().getPool(), arch_r, str_r.c_str(), prefix_r, flag_r ) )
250 : _id( relFromStr( myPool().getPool(),
Arch_empty, str_r, prefix_r, flag_r ) )
254 : _id( relFromStr( myPool().getPool(),
Arch_empty, str_r, prefix_r, flag_r ) )
258 : _id( relFromStr( myPool().getPool(), arch_r, str_r, prefix_r, flag_r ) )
262 : _id( relFromStr( myPool().getPool(), arch_r, str_r, prefix_r, flag_r ) )
270 : _id( relFromStr( myPool().getPool(), name_r,
Rel(op_r),
Edition(ed_r), prefix_r ) )
273 : _id( relFromStr( myPool().getPool(), name_r, op_r,
Edition(ed_r), prefix_r ) )
276 : _id( relFromStr( myPool().getPool(), name_r, op_r, ed_r, prefix_r ) )
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 ) )
287 : _id( relFromStr( myPool().getPool(),
Arch(arch_r), name_r, op_r,
Edition(ed_r), prefix_r ) )
290 : _id( relFromStr( myPool().getPool(),
Arch(arch_r), name_r, op_r, ed_r, prefix_r ) )
293 : _id( relFromStr( myPool().getPool(), arch_r, name_r,
Rel(op_r),
Edition(ed_r), prefix_r ) )
296 : _id( relFromStr( myPool().getPool(), arch_r, name_r, op_r,
Edition(ed_r), prefix_r ) )
299 : _id( relFromStr( myPool().getPool(), arch_r, name_r, op_r, ed_r, prefix_r ) )
307 : _id( ::pool_rel2id( myPool().getPool(), asIdString(namespace_r).id(), (value_r.empty() ? STRID_NULL : value_r.id() ), REL_NAMESPACE, true ) )
312 {
return(
_id ? ::pool_dep2str(
myPool().getPool(),
_id ) :
"" ); }
369 "/(s?bin|lib(64)?|etc)/|^/usr/(games/|share/(dict/words|magic\\.mime)$)|^/opt/gnome/games/",
407 if ( (pos = guess.rfind(
'-', pos-1 )) != std::string::npos )
462 if ( ! ISRELDEP(
_lhs) )
469 ::Reldep * rd = GETRELDEP(
myPool().getPool(),
_lhs );
478 if ( ! ISRELDEP(
_lhs) )
514 static const char archsep =
'.';
515 switch ( obj.
kind() )
518 return str <<
"<NoCap>";
530 return str <<
" " << obj.
op() <<
" " << obj.
ed();
547 return str <<
"<UnknownCap>";
559 return str <<
"UnknownCap";
573 return str <<
"UnknownCapRel";
Helper providing more detailed information about a Capability.
sat::detail::IdType _archIfSimple
CapRel
Enum values corresponding with libsolv defines.
Tri state Capability match result.
static const CapMatch irrelevant
static const CapMatch yes
static const Capability Null
No or Null Capability ( Id 0 ).
Capability()
Default ctor, Empty capability.
CapDetail detail() const
Helper providing more detailed information about a Capability.
const char * c_str() const
Conversion to const char *
static CapMatch _doMatch(sat::detail::IdType lhs, sat::detail::IdType rhs)
Match two Capabilities.
static bool isInterestingFileSpec(const IdString &name_r)
Test for a filename that is likely being REQUIRED.
static const Capability Empty
Empty Capability.
static Capability guessPackageSpec(const std::string &str_r)
Capability parser also guessing "libzypp-1.2.3-4.5.x86_64" formats.
Edition represents [epoch:]version[-release]
static const Edition noedition
Value representing noedition ("") This is in fact a valid Edition.
Access to the sat-pools string space.
const char * c_str() const
Conversion to const char *
constexpr bool empty() const
Whether the string is empty.
IdType id() const
Expert backdoor.
std::string asString() const
Conversion to std::string
static const ResKind srcpackage
static ResPool instance()
Singleton ctor.
byIdent_iterator byIdentBegin(const ByIdent &ident_r) const
byIdent_iterator byIdentEnd(const ByIdent &ident_r) const
Container of Solvable providing a Capability (read only).
bool empty() const
Whether the container is empty.
@ nosubs
Support for substring addressing of matches is not required.
Regular expression match result.
String related utilities and Regular expression matching.
static const IdType emptyId(1)
static const IdType noId(0)
int IdType
Generic Id type.
::s_Pool CPool
Wrapped libsolv C data type exposed as backdoor.
bool hasPrefix(const C_Str &str_r, const C_Str &prefix_r)
Return whether str_r has prefix prefix_r.
bool regex_match(const std::string &s, smatch &matches, const regex ®ex)
\relates regex \ingroup ZYPP_STR_REGEX \relates regex \ingroup ZYPP_STR_REGEX
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.
Easy-to use interface to the ZYPP dependency resolver.
std::ostream & operator<<(std::ostream &str, const Exception &obj)
std::string asString(const DefaultIntegral< Tp, TInitial > &obj)
ResolverNamespace
The resolvers dependency namespaces.
std::ostream & dumpOn(std::ostream &str, const Capability &obj)
bool overlaps(const Range< Tp, TCompare > &lhs, const Range< Tp, TCompare > &rhs)
const Arch Arch_empty(IdString::Empty)
static bool isRel(unsigned bits_r)
Test whether bits_r is a valid Rel (no extra bits set).
static PoolImpl & myPool()