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 ) )
303 {
return(
_id ? ::pool_dep2str(
myPool().getPool(),
_id ) :
"" ); }
307 #warning MIGRATE TO SAT
362 "/(s?bin|lib(64)?|etc)/|^/usr/(games/|share/(dict/words|magic\\.mime)$)|^/opt/gnome/games/",
398 if ( (pos = guess.rfind(
'-', pos-1 )) != std::string::npos )
432 return str << obj.
detail();
437 return str << obj.
detail();
453 if ( ! ISRELDEP(
_lhs) )
460 ::Reldep * rd = GETRELDEP(
myPool().getPool(),
_lhs );
469 if ( ! ISRELDEP(
_lhs) )
505 static const char archsep =
'.';
506 switch ( obj.
kind() )
509 return str <<
"<NoCap>";
514 str << archsep << obj.
arch();
520 str << archsep << obj.
arch();
521 return str <<
" " << obj.
op() <<
" " << obj.
ed();
538 return str <<
"<UnknownCap>";
550 return str <<
"UnknownCap";
564 return str <<
"UnknownCapRel";
int IdType
Generic Id type.
Container of Solvable providing a Capability (read only).
static CapMatch _doMatch(sat::detail::IdType lhs, sat::detail::IdType rhs)
Match two Capabilities.
static Capability guessPackageSpec(const std::string &str_r)
Capability parser also guessing "libzypp-1.2.3-4.5.x86_64" formats.
Helper providing more detailed information about a Capability.
unsigned split(const C_Str &line_r, _OutputIterator result_r, const C_Str &sepchars_r=" \t")
Split line_r into words.
bool empty() const
Whether the container is empty.
IdType id() const
Expert backdoor.
const Arch Arch_empty(IdString::Empty)
static const ResKind srcpackage
Access to the sat-pools string space.
Edition represents [epoch:]version[-release]
byIdent_iterator byIdentEnd(const ByIdent &ident_r) const
static bool isInterestingFileSpec(const IdString &name_r)
Test for a filename that is likely being REQUIRED.
Support for substring addressing of matches is not required.
std::string asString() const
Conversion to std::string
static const CapMatch irrelevant
CapDetail detail() const
Helper providing more detailed information about a Capability.
static const IdType emptyId(1)
static bool isRel(unsigned bits_r)
Test whether bits_r is a valid Rel (no extra bits set).
std::ostream & operator<<(std::ostream &str, const Exception &obj)
std::ostream & dumpOn(std::ostream &str, const Capability &obj)
static PoolImpl & myPool()
Tri state Capability match result.
const char * c_str() const
Conversion to const char *
static const Capability Null
No or Null Capability ( Id 0 ).
std::string asString(const Patch::SeverityFlag &obj)
bool overlaps(const Range< _Tp, _Compare > &lhs, const Range< _Tp, _Compare > &rhs)
Regular expression match result.
sat::detail::IdType _archIfSimple
static const IdType noId(0)
static const Capability Empty
Empty Capability.
Capability()
Default ctor, Empty capability.
bool regex_match(const std::string &s, smatch &matches, const regex ®ex)
regex ZYPP_STR_REGEX regex ZYPP_STR_REGEX
const char * c_str() const
Conversion to const char *
bool empty() const
Whether the string is empty.
CapRel
Enum values corresponding with libsolv defines.
static const CapMatch yes
byIdent_iterator byIdentBegin(const ByIdent &ident_r) const
bool hasPrefix(const C_Str &str_r, const C_Str &prefix_r)
Return whether str_r has prefix prefix_r.
static const Edition noedition
Value representing noedition ("") This is in fact a valid Edition.
static ResPool instance()
Singleton ctor.