libzypp  10.5.0
zypp::Edition Class Reference

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

#include <Edition.h>

Inheritance diagram for zypp::Edition:

List of all members.

Classes

struct  Match
 match functor. More...

Public Types

typedef unsigned epoch_t
 Type of an epoch.
typedef zypp::Compare< EditionCompare
 compare functor.
typedef Range< EditionCompareRange
 Edition Range based on Compare.
typedef Range< Edition, MatchMatchRange
 Edition Range based on Match.

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)
 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)
epoch_t epoch () const
 Epoch.
std::string version () const
 Version.
std::string release () const
 Release.

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.

Static Private Member Functions

static int _doCompare (const char *lhs, const char *rhs)
static int _doMatch (const char *lhs, const char *rhs)

Private Attributes

IdString _str

Friends

class IdStringType< Edition >

Match two Editions

Match two Editions returning -1,0,1, treating empty version/release strings as ANY.

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)

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 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 (==)
    
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

typedef unsigned zypp::Edition::epoch_t

Type of an epoch.

Definition at line 64 of file Edition.h.


Constructor & Destructor Documentation

zypp::Edition::Edition ( ) [inline]

Default ctor: noedition.

Definition at line 77 of file Edition.h.

zypp::Edition::Edition ( IdString::IdType  id_r) [inline, explicit]

Ctor taking edition as string.

Definition at line 80 of file Edition.h.

zypp::Edition::Edition ( const IdString idstr_r) [inline, explicit]

Definition at line 81 of file Edition.h.

zypp::Edition::Edition ( const std::string &  str_r) [inline, explicit]

Definition at line 82 of file Edition.h.

zypp::Edition::Edition ( const char *  cstr_r) [inline, explicit]

Definition at line 83 of file Edition.h.

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.

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.

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.

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

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

Epoch.

Definition at line 82 of file Edition.cc.

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

Version.

Definition at line 94 of file Edition.cc.

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

Release.

Definition at line 110 of file Edition.cc.

static int zypp::Edition::match ( const Edition lhs,
const Edition rhs 
) [inline, static]

Definition at line 130 of file Edition.h.

static int zypp::Edition::match ( const Edition lhs,
const IdString rhs 
) [inline, static]

Definition at line 131 of file Edition.h.

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

Definition at line 132 of file Edition.h.

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

Definition at line 133 of file Edition.h.

static int zypp::Edition::match ( const IdString lhs,
const Edition rhs 
) [inline, static]

Definition at line 135 of file Edition.h.

static int zypp::Edition::match ( const IdString lhs,
const IdString rhs 
) [inline, static]

Definition at line 136 of file Edition.h.

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

Definition at line 138 of file Edition.h.

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

Definition at line 139 of file Edition.h.

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

Definition at line 141 of file Edition.h.

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

Definition at line 142 of file Edition.h.

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

Definition at line 143 of file Edition.h.

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

Definition at line 144 of file Edition.h.

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

Definition at line 146 of file Edition.h.

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

Definition at line 147 of file Edition.h.

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

Definition at line 148 of file Edition.h.

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

Definition at line 149 of file Edition.h.

int zypp::Edition::match ( const Edition rhs) const [inline]

Definition at line 151 of file Edition.h.

int zypp::Edition::match ( const IdString rhs) const [inline]

Definition at line 152 of file Edition.h.

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

Definition at line 153 of file Edition.h.

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

Definition at line 154 of file Edition.h.

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

Reimplemented from zypp::IdStringType< Edition >.

Definition at line 120 of file Edition.cc.

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

Definition at line 127 of file Edition.cc.


Friends And Related Function Documentation

friend class IdStringType< Edition > [friend]

Definition at line 176 of file Edition.h.


Member Data Documentation

const epoch_t zypp::Edition::noepoch = 0 [static]

Value representing noepoch.

Definition at line 67 of file Edition.h.

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.

Definition at line 177 of file Edition.h.


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