31 inline std::string makeevrstr(
const std::string & version_r,
32 const std::string & release_r,
35 std::string ret( version_r );
36 if ( ! release_r.empty() )
45 inline std::string makeevrstr(
const char * version_r,
46 const char * release_r,
48 {
return makeevrstr( std::string(version_r?version_r:
""),
49 std::string(release_r?release_r:
""),
61 const std::string & release_r,
63 : _str( makeevrstr( version_r, release_r, epoch_r ) )
67 const char * release_r,
69 : _str( makeevrstr( version_r, release_r, epoch_r ) )
73 const std::string & release_r,
74 const std::string & epoch_r )
79 const char * release_r,
80 const char * epoch_r )
87 const char * sep =
str;
89 for ( ; *sep >=
'0' && *sep <=
'9'; ++sep )
92 return str::strtonum<epoch_t>( std::string(
str, sep-
str ) );
99 const char * sep =
str;
101 for ( ; *sep >=
'0' && *sep <=
'9'; ++sep )
106 sep = ::strrchr(
str,
'-' );
108 return std::string(
str, sep-
str );
115 const char * sep = ::strrchr(
str,
'-' );
119 return std::string();
124 if ( lhs == rhs )
return 0;
125 if ( lhs && rhs ) return ::pool_evrcmp_str(
StringPool::instance().getPool(), lhs, rhs, EVRCMP_COMPARE );
126 return( lhs ? 1 : -1 );
131 if ( lhs == rhs )
return 0;
132 if ( lhs && rhs ) return ::pool_evrcmp_str(
StringPool::instance().getPool(), lhs, rhs, EVRCMP_MATCH );
133 return( lhs ? 1 : -1 );
static int _doCompare(const char *lhs, const char *rhs) ZYPP_API
static int _doMatch(const char *lhs, const char *rhs)
String related utilities and Regular expression matching.
static StringPool & instance()
Access the global StringPool instance.
std::string version() const
Version.
Singleton manager for the underlying libsolv string pool.
std::string release() const
Release.
Edition()
Default ctor: noedition.
unsigned int epoch_t
Type of an epoch.
TInt strtonum(const C_Str &str)
Parsing numbers from string.
std::string numstring(char n, int w=0)
Editions with v-r setparator highlighted.
epoch_t epoch() const
Epoch.
Easy-to use interface to the ZYPP dependency resolver.
const char * c_str() const
static const Edition noedition
Value representing noedition ("") This is in fact a valid Edition.