29 inline std::string makeevrstr(
const std::string & version_r,
30 const std::string & release_r,
33 std::string ret( version_r );
34 if ( ! release_r.empty() )
43 inline std::string makeevrstr(
const char * version_r,
44 const char * release_r,
46 {
return makeevrstr( std::string(version_r?version_r:
""),
47 std::string(release_r?release_r:
""),
59 const std::string & release_r,
61 : _str( makeevrstr( version_r, release_r, epoch_r ) )
65 const char * release_r,
67 : _str( makeevrstr( version_r, release_r, epoch_r ) )
71 const std::string & release_r,
72 const std::string & epoch_r )
73 : _str( makeevrstr( version_r, release_r, str::
strtonum<
epoch_t>( epoch_r ) ) )
77 const char * release_r,
78 const char * epoch_r )
79 : _str( makeevrstr( version_r, release_r, str::
strtonum<
epoch_t>( epoch_r ) ) )
84 const char * str(
c_str() );
85 const char * sep = str;
87 for ( ; *sep >=
'0' && *sep <=
'9'; ++sep )
90 return str::strtonum<epoch_t>( std::string( str, sep-str ) );
96 const char * str(
c_str() );
97 const char * sep = str;
99 for ( ; *sep >=
'0' && *sep <=
'9'; ++sep )
104 sep = ::strrchr( str,
'-' );
106 return std::string( str, sep-str );
112 const char * str(
c_str() );
113 const char * sep = ::strrchr( str,
'-' );
117 return std::string();
122 if ( lhs == rhs )
return 0;
123 if ( lhs && rhs ) return ::pool_evrcmp_str(
myPool().getPool(), lhs, rhs, EVRCMP_COMPARE );
124 return( lhs ? 1 : -1 );
129 if ( lhs == rhs )
return 0;
130 if ( lhs && rhs ) return ::pool_evrcmp_str(
myPool().getPool(), lhs, rhs, EVRCMP_MATCH );
131 return( lhs ? 1 : -1 );
static int _doMatch(const char *lhs, const char *rhs)
std::string release() const
Release.
unsigned epoch_t
Type of an epoch.
static int _doCompare(const char *lhs, const char *rhs)
Edition()
Default ctor: noedition.
epoch_t epoch() const
Epoch.
std::string version() const
Version.
_It strtonum(const C_Str &str)
Parsing numbers from string.
static PoolImpl & myPool()
std::string numstring(char n, int w=0)
const char * c_str() const
static const Edition noedition
Value representing noedition ("") This is in fact a valid Edition.