libzypp 17.37.10

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.

## 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.

## Related Symbols
(Note that these are not member symbols.)
std::ostream & | dumpAsXmlOn (std::ostream &str, const Edition &obj)
| XML output.
Related Symbols inherited from zypp::IdStringType< Edition >
std::ostream & | operator<< (std::ostream &str, const IdStringType< Edition > &obj)
| Stream output.
bool | operator== (const IdStringType< Edition > &lhs, const IdStringType< Edition > &rhs)
| Equal.
bool | operator!= (const IdStringType< Edition > &lhs, const IdStringType< Edition > &rhs)
| NotEqual.
bool | operator< (const IdStringType< Edition > &lhs, const IdStringType< Edition > &rhs)
| Less.
bool | operator<= (const IdStringType< Edition > &lhs, const IdStringType< Edition > &rhs)
| LessEqual.
bool | operator> (const IdStringType< Edition > &lhs, const IdStringType< Edition > &rhs)
| Greater.
bool | operator>= (const IdStringType< Edition > &lhs, const IdStringType< Edition > &rhs)
| GreaterEqual.

## 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)
Protected Member Functions inherited from zypp::IdStringType< Edition >
| IdStringType ()=default
IdStringType & | operator= (const IdStringType &)=default
| ~IdStringType ()=default
Static Protected Member Functions inherited from zypp::sat::detail::PoolMember
static PoolImpl & | myPool ()

## 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:134
  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 60 of file Edition.h.

## Member Typedef Documentation

## ◆ epoch_t

using zypp::Edition::epoch_t = unsigned int

Type of an epoch.

Definition at line 64 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 117 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 122 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 169 of file Edition.h.

## Constructor & Destructor Documentation

## ◆ Edition() [1/9]

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

Default ctor: noedition.

Definition at line 77 of file Edition.h.

## ◆ Edition() [2/9]

zypp::Edition::Edition | ( | IdString::IdType | id_r | ) |
| inline explicit

Ctor taking edition as string.

Definition at line 80 of file Edition.h.

## ◆ Edition() [3/9]

zypp::Edition::Edition | ( | const IdString & | idstr_r | ) |
| inline explicit

Definition at line 81 of file Edition.h.

## ◆ Edition() [4/9]

zypp::Edition::Edition | ( | const std::string & | str_r | ) |
| inline explicit

Definition at line 82 of file Edition.h.

## ◆ Edition() [5/9]

zypp::Edition::Edition | ( | const char * | cstr_r | ) |
| inline explicit

Definition at line 83 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 58 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 64 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 70 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 76 of file Edition.cc.

## Member Function Documentation

## ◆ epoch()

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

Epoch.

Definition at line 82 of file Edition.cc.

## ◆ version()

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

Version.

Definition at line 94 of file Edition.cc.

## ◆ release()

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

Release.

Definition at line 110 of file Edition.cc.

## ◆ match() [1/20]

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

Definition at line 130 of file Edition.h.

## ◆ match() [2/20]

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

Definition at line 131 of file Edition.h.

## ◆ match() [3/20]

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

Definition at line 132 of file Edition.h.

## ◆ match() [4/20]

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

Definition at line 133 of file Edition.h.

## ◆ match() [5/20]

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

Definition at line 135 of file Edition.h.

## ◆ match() [6/20]

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

Definition at line 136 of file Edition.h.

## ◆ match() [7/20]

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

Definition at line 138 of file Edition.h.

## ◆ match() [8/20]

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

Definition at line 139 of file Edition.h.

## ◆ match() [9/20]

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

Definition at line 141 of file Edition.h.

## ◆ match() [10/20]

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

Definition at line 142 of file Edition.h.

## ◆ match() [11/20]

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

Definition at line 143 of file Edition.h.

## ◆ match() [12/20]

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

Definition at line 144 of file Edition.h.

## ◆ match() [13/20]

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

Definition at line 146 of file Edition.h.

## ◆ match() [14/20]

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

Definition at line 147 of file Edition.h.

## ◆ match() [15/20]

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

Definition at line 148 of file Edition.h.

## ◆ match() [16/20]

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

Definition at line 149 of file Edition.h.

## ◆ match() [17/20]

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

Definition at line 151 of file Edition.h.

## ◆ match() [18/20]

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

Definition at line 152 of file Edition.h.

## ◆ match() [19/20]

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

Definition at line 153 of file Edition.h.

## ◆ match() [20/20]

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

Definition at line 154 of file Edition.h.

## ◆ _doCompare()

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

Definition at line 120 of file Edition.cc.

## ◆ _doMatch()

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

Definition at line 127 of file Edition.cc.

## Friends And Related Symbol Documentation

## ◆ IdStringType< Edition >

friend class IdStringType< Edition >
| friend

Definition at line 173 of file Edition.h.

## ◆ dumpAsXmlOn()

std::ostream & dumpAsXmlOn | ( | std::ostream & | str,
|  | const Edition & | obj )
| related

XML output.

Definition at line 182 of file Edition.h.

## Member Data Documentation

## ◆ noepoch

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

Value representing `noepoch`.

Definition at line 67 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 73 of file Edition.h.

## ◆ _str

IdString zypp::Edition::_str
| private

Definition at line 177 of file Edition.h.

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

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