12#ifndef ZYPP_IDSTRINGTYPE_H
13#define ZYPP_IDSTRINGTYPE_H
18#if ( LEGACY(1735) ) && !ZYPPNG
90 template <
class Derived>
92 #if (
LEGACY(1735) ) && !ZYPPNG
108 const Derived &
self()
const {
return *
static_cast<const Derived*
>( this ); }
118#ifdef __cpp_lib_string_view
119 std::string_view asStringView()
const {
return idStr().asStringView(); }
120 explicit operator std::string_view()
const {
return asStringView(); }
128 {
return !
empty(); }
135 explicit operator std::string()
const
142 static int compare(
const Derived & lhs,
const Derived & rhs ) {
return compare( lhs.idStr(), rhs.idStr() ); }
144 static int compare(
const Derived & lhs,
const std::string & rhs ) {
return compare( lhs.idStr(), rhs.c_str() ); }
145 static int compare(
const Derived & lhs,
const char * rhs ) {
return compare( lhs.idStr(), rhs );}
148 static int compare(
const IdString & lhs,
const IdString & rhs ) {
return lhs == rhs ? 0 : Derived::_doCompare( (lhs ? lhs.
c_str() : (
const char *)0 ),
149 (rhs ? rhs.
c_str() : (
const char *)0 ) ); }
151 static int compare(
const IdString & lhs,
const char * rhs ) {
return Derived::_doCompare( (lhs ? lhs.
c_str() : (
const char *)0 ), rhs ); }
153 static int compare(
const std::string & lhs,
const Derived & rhs ) {
return compare( lhs.c_str(), rhs.idStr() ); }
155 static int compare(
const std::string & lhs,
const std::string & rhs ) {
return compare( lhs.c_str(), rhs.c_str() ); }
156 static int compare(
const std::string & lhs,
const char * rhs ) {
return compare( lhs.c_str(), rhs ); }
158 static int compare(
const char * lhs,
const Derived & rhs ) {
return compare( lhs, rhs.idStr() ); }
159 static int compare(
const char * lhs,
const IdString & rhs ) {
return Derived::_doCompare( lhs, (rhs ? rhs.
c_str() : (
const char *)0 ) ); }
160 static int compare(
const char * lhs,
const std::string & rhs ) {
return compare( lhs, rhs.c_str() ); }
161 static int compare(
const char * lhs,
const char * rhs ) {
return Derived::_doCompare( lhs, rhs ); }
173 if ( ! lhs )
return rhs ? -1 : 0;
174 return rhs ? ::strcmp( lhs, rhs ) : 1;
180 template <
class Derived>
185 template <
class Derived>
187 {
return lhs.
compare( rhs ) == 0; }
189 template <
class Derived>
191 {
return lhs.
compare( rhs ) == 0; }
193 template <
class Derived>
195 {
return lhs.
compare( rhs ) == 0; }
197 template <
class Derived>
199 {
return lhs.
compare( rhs ) == 0; }
201 template <
class Derived>
203 {
return rhs.
compare( lhs ) == 0; }
205 template <
class Derived>
207 {
return rhs.
compare( lhs ) == 0; }
209 template <
class Derived>
211 {
return rhs.
compare( lhs ) == 0; }
214 template <
class Derived>
216 {
return lhs.
compare( rhs ) != 0; }
218 template <
class Derived>
220 {
return lhs.
compare( rhs ) != 0; }
222 template <
class Derived>
224 {
return lhs.
compare( rhs ) != 0; }
226 template <
class Derived>
228 {
return lhs.
compare( rhs ) != 0; }
230 template <
class Derived>
232 {
return rhs.
compare( lhs ) != 0; }
234 template <
class Derived>
236 {
return rhs.
compare( lhs ) != 0; }
238 template <
class Derived>
240 {
return rhs.
compare( lhs ) != 0; }
243 template <
class Derived>
245 {
return lhs.
compare( rhs ) < 0; }
247 template <
class Derived>
249 {
return lhs.
compare( rhs ) < 0; }
251 template <
class Derived>
253 {
return lhs.
compare( rhs ) < 0; }
255 template <
class Derived>
257 {
return lhs.
compare( rhs ) < 0; }
259 template <
class Derived>
261 {
return rhs.
compare( lhs ) >= 0; }
263 template <
class Derived>
265 {
return rhs.
compare( lhs ) >= 0; }
267 template <
class Derived>
269 {
return rhs.
compare( lhs ) >= 0; }
272 template <
class Derived>
274 {
return lhs.
compare( rhs ) <= 0; }
276 template <
class Derived>
278 {
return lhs.
compare( rhs ) <= 0; }
280 template <
class Derived>
282 {
return lhs.
compare( rhs ) <= 0; }
284 template <
class Derived>
286 {
return lhs.
compare( rhs ) <= 0; }
288 template <
class Derived>
290 {
return rhs.
compare( lhs ) > 0; }
292 template <
class Derived>
294 {
return rhs.
compare( lhs ) > 0; }
296 template <
class Derived>
298 {
return rhs.
compare( lhs ) > 0; }
301 template <
class Derived>
303 {
return lhs.
compare( rhs ) > 0; }
305 template <
class Derived>
307 {
return lhs.
compare( rhs ) > 0; }
309 template <
class Derived>
311 {
return lhs.
compare( rhs ) > 0; }
313 template <
class Derived>
315 {
return lhs.
compare( rhs ) > 0; }
317 template <
class Derived>
319 {
return rhs.
compare( lhs ) <= 0; }
321 template <
class Derived>
323 {
return rhs.
compare( lhs ) <= 0; }
325 template <
class Derived>
327 {
return rhs.
compare( lhs ) <= 0; }
330 template <
class Derived>
332 {
return lhs.
compare( rhs ) >= 0; }
334 template <
class Derived>
336 {
return lhs.
compare( rhs ) >= 0; }
338 template <
class Derived>
340 {
return lhs.
compare( rhs ) >= 0; }
342 template <
class Derived>
344 {
return lhs.
compare( rhs ) >= 0; }
346 template <
class Derived>
348 {
return rhs.
compare( lhs ) < 0; }
350 template <
class Derived>
352 {
return rhs.
compare( lhs ) < 0; }
354 template <
class Derived>
356 {
return rhs.
compare( lhs ) < 0; }
#define LEGACY(CL)
Legacy code we still support.
Base class for creating IdString based types.
IdStringType(IdStringType &&) noexcept=default
static int compare(const char *lhs, const std::string &rhs)
static int compare(const Derived &lhs, const IdString &rhs)
int compare(const std::string &rhs) const
const Derived & self() const
int compare(const char *rhs) const
static int compare(const std::string &lhs, const Derived &rhs)
static int compare(const IdString &lhs, const IdString &rhs)
IdStringType & operator=(const IdStringType &)=default
static int compare(const char *lhs, const char *rhs)
static int compare(const IdString &lhs, const std::string &rhs)
const char * c_str() const
static int compare(const char *lhs, const Derived &rhs)
int compare(const IdStringType &rhs) const
static int compare(const Derived &lhs, const char *rhs)
static int compare(const std::string &lhs, const std::string &rhs)
static int compare(const std::string &lhs, const char *rhs)
static int compare(const char *lhs, const IdString &rhs)
static int _doCompare(const char *lhs, const char *rhs) ZYPP_API
IdStringType(const IdStringType &)=default
static int compare(const std::string &lhs, const IdString &rhs)
std::string asString() const
int compare(const Derived &rhs) const
static int compare(const IdString &lhs, const Derived &rhs)
static int compare(const Derived &lhs, const Derived &rhs)
int compare(const IdString &rhs) const
static int compare(const IdString &lhs, const char *rhs)
static int compare(const Derived &lhs, const std::string &rhs)
Access to the sat-pools string space.
const char * c_str() const
Conversion to const char *.
sat::detail::IdType IdType
String related utilities and Regular expression matching.
Easy-to use interface to the ZYPP dependency resolver.
bool operator>(const IdString &lhs, const IdString &rhs)
relates: IdString Greater
bool operator>=(const IdString &lhs, const IdString &rhs)
relates: IdString GreaterEqual
bool operator<(const Capability &lhs, const Capability &rhs)
relates: Capability Arbitrary order.
bool operator!=(const Capability &lhs, const Capability &rhs)
relates: Capability
bool operator<=(const IdString &lhs, const IdString &rhs)
relates: IdString LessEqual
bool operator==(const Capability &lhs, const Capability &rhs)
relates: Capability
const Arch Arch_empty ZYPP_API
relates: Arch This is an empty Arch represented by an empty string.
std::string asString(const Patch::Category &obj)
relates: Patch::Category string representation.
std::ostream & operator<<(std::ostream &str, const Capabilities &obj)
relates: Capabilities Stream output
Backlink to the associated PoolImpl.