libzypp: zypp::Edition Class Reference

libzypp 17.38.6

zypp::Edition Class Reference

Edition represents `[epoch:]version[-release]`. More...

`#include <zypp/Edition.h>`

Inheritance diagram for zypp::Edition:

## Classes
struct | Match
| match functor. More...

## Public Types
using | epoch_t = unsigned int
| Type of an epoch.
using | Compare = zypp::Compare<Edition>
| compare functor.
using | CompareRange = Range<Edition>
| Edition Range based on Compare.
Public Types inherited from zypp::IdStringType< Edition >
using | IdType

## Public Member Functions
| Edition ()
| Default ctor: noedition.
| Edition (IdString::IdType id_r)
| Ctor taking edition as string.
| Edition (const IdString &idstr_r)
| Edition (const std::string &str_r)
| Edition (const char *cstr_r)
| Edition (const std::string &version_r, const std::string &release_r, epoch_t epoch_r=noepoch)
| Ctor taking version_r, release_r and optional epoch_r.
| Edition (const char *version_r, const char *release_r, epoch_t epoch_r=noepoch)
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| Edition (const std::string &version_r, const std::string &release_r, const std::string &epoch_r)
| Ctor taking version_r, release_r and optional epoch_r as string.
| Edition (const char *version_r, const char *release_r, const char *epoch_r)
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
epoch_t | epoch () const
| Epoch.
std::string | version () const
| Version.
std::string | release () const
| Release.
Public Member Functions inherited from zypp::IdStringType< Edition >
IdString | idStr () const
bool | empty () const
unsigned | size () const
const char * | c_str () const
std::string | asString () const
IdType | id () const
| operator bool () const
| Evaluate in a boolean context ( !
| operator IdString () const
| Explicit conversion to IdString.
| operator std::string () const
| Explicit conversion to std::string.
int | compare (const Edition &rhs) const
int | compare (const IdStringType &rhs) const
int | compare (const IdString &rhs) const
int | compare (const std::string &rhs) const
int | compare (const char *rhs) const

## Static Public Attributes
static const epoch_t | noepoch = 0
| Value representing `noepoch`.
static const Edition | noedition
| Value representing `noedition` ("") This is in fact a valid Edition.

## Match two Editions
Match two Editions returning -1,0,1, treating empty version/release strings as `ANY`.
using | MatchRange = Range<Edition, Match>
| Edition Range based on Match.
class | IdStringType< Edition >
IdString | _str
int | match (const Edition &rhs) const
int | match (const IdString &rhs) const
int | match (const std::string &rhs) const
int | match (const char *rhs) const
static int | match (const Edition &lhs, const Edition &rhs)
static int | match (const Edition &lhs, const IdString &rhs)
static int | match (const Edition &lhs, const std::string &rhs)
static int | match (const Edition &lhs, const char *rhs)
static int | match (const IdString &lhs, const Edition &rhs)
static int | match (const IdString &lhs, const IdString &rhs)
static int | match (const IdString &lhs, const std::string &rhs)
static int | match (const IdString &lhs, const char *rhs)
static int | match (const std::string &lhs, const Edition &rhs)
static int | match (const std::string &lhs, const IdString &rhs)
static int | match (const std::string &lhs, const std::string &rhs)
static int | match (const std::string &lhs, const char *rhs)
static int | match (const char *lhs, const Edition &rhs)
static int | match (const char *lhs, const IdString &rhs)
static int | match (const char *lhs, const std::string &rhs)
static int | match (const char *lhs, const char *rhs)
static int | _doCompare (const char *lhs, const char *rhs) ZYPP_API
static int | _doMatch (const char *lhs, const char *rhs)

## Additional Inherited Members
Static Public Member Functions inherited from zypp::IdStringType< Edition >
static int | compare (const Edition &lhs, const Edition &rhs)
static int | compare (const Edition &lhs, const IdString &rhs)
static int | compare (const Edition &lhs, const std::string &rhs)
static int | compare (const Edition &lhs, const char *rhs)
static int | compare (const IdString &lhs, const Edition &rhs)
static int | compare (const IdString &lhs, const IdString &rhs)
static int | compare (const IdString &lhs, const std::string &rhs)
static int | compare (const IdString &lhs, const char *rhs)
static int | compare (const std::string &lhs, const Edition &rhs)
static int | compare (const std::string &lhs, const IdString &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 Edition &rhs)
static int | compare (const char *lhs, const IdString &rhs)
static int | compare (const char *lhs, const std::string &rhs)
static int | compare (const char *lhs, const char *rhs)
Protected Member Functions inherited from zypp::IdStringType< Edition >
| IdStringType ()=default
| IdStringType (const IdStringType &)=default
| IdStringType (IdStringType &&) noexcept=default
IdStringType & | operator= (const IdStringType &)=default
IdStringType & | operator= (IdStringType &&) noexcept=default
| ~IdStringType ()=default

## Detailed Description

Edition represents `[epoch:]version[-release]`.

- `epoch` (optional) number, Edition::noepoch if not supplied
- `version` (required) string, may not contain '-'
- `release` (optional) string, may not contain '-'

Comparison is actually \reg g_BackendSpecific.

- RPM: Edition are ordered according to `epoch`, then `version`, then `release`. Version and release strings are compared by splitting them into segments of alpha or digit sequences. Segments are compared according to their type. On mixed types a string compares less than a number.
  compare( 1.a, 1.0 ) == -1 (<)
  compare( 1.0, 1.a ) == 1 (>)
  compare( 1.0, 1_0 ) == 0 (==)
  zypp::IdStringType< Edition >::compare
  static int compare(const Edition &lhs, const Edition &rhs)
  Definition IdStringType.h:142
  a
  unsigned short a
  Definition mediablocklist.cc:0

Attention
  operator< defines equivalence classes of version strings, as non alphanumeric chars are ignored. That' why `1.0` and `1_0` compare equal in the example.
  Edition::match compares two editions, treating empty version or release strings as wildcard. Thus match is not transitive, and you don't want to use it to order keys in a a std::container.

Definition at line 59 of file Edition.h.

## Member Typedef Documentation

## ◆ epoch_t

using zypp::Edition::epoch_t = unsigned int

Type of an epoch.

Definition at line 63 of file Edition.h.

## ◆ Compare

using zypp::Edition::Compare = zypp::Compare<Edition>

compare functor.

See also
  Comparison using relational operator zypp::Rel..

Definition at line 116 of file Edition.h.

## ◆ CompareRange

using zypp::Edition::CompareRange = Range<Edition>

Edition Range based on Compare.

See also
  Comparison using relational operator zypp::Rel..

Definition at line 121 of file Edition.h.

## ◆ MatchRange

using zypp::Edition::MatchRange = Range<Edition, Match>

Edition Range based on Match.

See also
  Comparison using relational operator zypp::Rel..

Definition at line 168 of file Edition.h.

## Constructor & Destructor Documentation

## ◆ Edition() [1/9]

zypp::Edition::Edition | ( |  | ) |
| inline

Default ctor: noedition.

Definition at line 76 of file Edition.h.

## ◆ Edition() [2/9]

zypp::Edition::Edition | ( | IdString::IdType | id_r | ) |
| inlineexplicit

Ctor taking edition as string.

Definition at line 79 of file Edition.h.

## ◆ Edition() [3/9]

zypp::Edition::Edition | ( | const IdString & | idstr_r | ) |
| inlineexplicit

Definition at line 80 of file Edition.h.

## ◆ Edition() [4/9]

zypp::Edition::Edition | ( | const std::string & | str_r | ) |
| inlineexplicit

Definition at line 81 of file Edition.h.

## ◆ Edition() [5/9]

zypp::Edition::Edition | ( | const char * | cstr_r | ) |
| inlineexplicit

Definition at line 82 of file Edition.h.

## ◆ Edition() [6/9]

zypp::Edition::Edition | ( | const std::string & | version_r,
|  | const std::string & | release_r,
|  | epoch_t | epoch_r = noepoch )

Ctor taking version_r, release_r and optional epoch_r.

Definition at line 60 of file Edition.cc.

## ◆ Edition() [7/9]

zypp::Edition::Edition | ( | const char * | version_r,
|  | const char * | release_r,
|  | epoch_t | epoch_r = noepoch )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 66 of file Edition.cc.

## ◆ Edition() [8/9]

zypp::Edition::Edition | ( | const std::string & | version_r,
|  | const std::string & | release_r,
|  | const std::string & | epoch_r )

Ctor taking version_r, release_r and optional epoch_r as string.

Definition at line 72 of file Edition.cc.

## ◆ Edition() [9/9]

zypp::Edition::Edition | ( | const char * | version_r,
|  | const char * | release_r,
|  | const char * | epoch_r )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 78 of file Edition.cc.

## Member Function Documentation

## ◆ epoch()

Edition::epoch_t zypp::Edition::epoch | ( |  | ) | const

Epoch.

Definition at line 84 of file Edition.cc.

## ◆ version()

std::string zypp::Edition::version | ( |  | ) | const

Version.

Definition at line 96 of file Edition.cc.

## ◆ release()

std::string zypp::Edition::release | ( |  | ) | const

Release.

Definition at line 112 of file Edition.cc.

## ◆ match() [1/20]

int zypp::Edition::match | ( | const Edition & | lhs,
|  | const Edition & | rhs )
| inlinestatic

Definition at line 129 of file Edition.h.

## ◆ match() [2/20]

int zypp::Edition::match | ( | const Edition & | lhs,
|  | const IdString & | rhs )
| inlinestatic

Definition at line 130 of file Edition.h.

## ◆ match() [3/20]

int zypp::Edition::match | ( | const Edition & | lhs,
|  | const std::string & | rhs )
| inlinestatic

Definition at line 131 of file Edition.h.

## ◆ match() [4/20]

int zypp::Edition::match | ( | const Edition & | lhs,
|  | const char * | rhs )
| inlinestatic

Definition at line 132 of file Edition.h.

## ◆ match() [5/20]

int zypp::Edition::match | ( | const IdString & | lhs,
|  | const Edition & | rhs )
| inlinestatic

Definition at line 134 of file Edition.h.

## ◆ match() [6/20]

int zypp::Edition::match | ( | const IdString & | lhs,
|  | const IdString & | rhs )
| inlinestatic

Definition at line 135 of file Edition.h.

## ◆ match() [7/20]

int zypp::Edition::match | ( | const IdString & | lhs,
|  | const std::string & | rhs )
| inlinestatic

Definition at line 137 of file Edition.h.

## ◆ match() [8/20]

int zypp::Edition::match | ( | const IdString & | lhs,
|  | const char * | rhs )
| inlinestatic

Definition at line 138 of file Edition.h.

## ◆ match() [9/20]

int zypp::Edition::match | ( | const std::string & | lhs,
|  | const Edition & | rhs )
| inlinestatic

Definition at line 140 of file Edition.h.

## ◆ match() [10/20]

int zypp::Edition::match | ( | const std::string & | lhs,
|  | const IdString & | rhs )
| inlinestatic

Definition at line 141 of file Edition.h.

## ◆ match() [11/20]

int zypp::Edition::match | ( | const std::string & | lhs,
|  | const std::string & | rhs )
| inlinestatic

Definition at line 142 of file Edition.h.

## ◆ match() [12/20]

int zypp::Edition::match | ( | const std::string & | lhs,
|  | const char * | rhs )
| inlinestatic

Definition at line 143 of file Edition.h.

## ◆ match() [13/20]

int zypp::Edition::match | ( | const char * | lhs,
|  | const Edition & | rhs )
| inlinestatic

Definition at line 145 of file Edition.h.

## ◆ match() [14/20]

int zypp::Edition::match | ( | const char * | lhs,
|  | const IdString & | rhs )
| inlinestatic

Definition at line 146 of file Edition.h.

## ◆ match() [15/20]

int zypp::Edition::match | ( | const char * | lhs,
|  | const std::string & | rhs )
| inlinestatic

Definition at line 147 of file Edition.h.

## ◆ match() [16/20]

int zypp::Edition::match | ( | const char * | lhs,
|  | const char * | rhs )
| inlinestatic

Definition at line 148 of file Edition.h.

## ◆ match() [17/20]

int zypp::Edition::match | ( | const Edition & | rhs | ) | const
| inline

Definition at line 150 of file Edition.h.

## ◆ match() [18/20]

int zypp::Edition::match | ( | const IdString & | rhs | ) | const
| inline

Definition at line 151 of file Edition.h.

## ◆ match() [19/20]

int zypp::Edition::match | ( | const std::string & | rhs | ) | const
| inline

Definition at line 152 of file Edition.h.

## ◆ match() [20/20]

int zypp::Edition::match | ( | const char * | rhs | ) | const
| inline

Definition at line 153 of file Edition.h.

## ◆ _doCompare()

int zypp::Edition::_doCompare | ( | const char * | lhs,
|  | const char * | rhs )
| staticprivate

Definition at line 122 of file Edition.cc.

## ◆ _doMatch()

int zypp::Edition::_doMatch | ( | const char * | lhs,
|  | const char * | rhs )
| staticprivate

Definition at line 129 of file Edition.cc.

## Friends And Related Symbol Documentation

## ◆ IdStringType< Edition >

friend class IdStringType< Edition >
| friend

Definition at line 172 of file Edition.h.

## Member Data Documentation

## ◆ noepoch

const epoch_t zypp::Edition::noepoch = 0
| static

Value representing `noepoch`.

Definition at line 66 of file Edition.h.

## ◆ noedition

const Edition zypp::Edition::noedition
| static

Value representing `noedition` ("") This is in fact a valid Edition.

It's what the default ctor creates or will be parsed from an empty string.

Definition at line 72 of file Edition.h.

## ◆ _str

IdString zypp::Edition::_str
| private

Definition at line 176 of file Edition.h.

The documentation for this class was generated from the following files:

- zypp/Edition.h
- zypp/Edition.cc