Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

PkgEdition Class Reference

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

#include <PkgEdition.h>

List of all members.

Public Types

enum  type_enum { NORMAL, MAXIMUM, UNSPEC }

Public Member Functions

 PkgEdition (type_enum t=NORMAL)
 PkgEdition (const std::string &v, const std::string &r="", time_t bt=0)
 PkgEdition (const std::string &v, time_t bt)
 PkgEdition (unsigned e, const std::string &v, const std::string &r="", time_t bt=0)
 PkgEdition (unsigned e, const std::string &v, time_t bt)
 ~PkgEdition ()
const std::string & version () const
const std::string & release () const
int epoch () const
bool has_epoch () const
time_t buildtime () const
bool is_unspecified () const
bool is_maximum () const
bool compare (rel_op op, const PkgEdition &e2) const
bool operator== (const PkgEdition &e2) const
bool operator!= (const PkgEdition &e2) const
bool operator< (const PkgEdition &e2) const
bool operator<= (const PkgEdition &e2) const
bool operator> (const PkgEdition &e2) const
bool operator>= (const PkgEdition &e2) const
std::string asString () const

Static Public Member Functions

std::string toString (const PkgEdition &t)
PkgEdition fromString (std::string s)

Private Member Functions

bool edition_eq (const PkgEdition &e2) const
bool edition_lt (const PkgEdition &e2) const
int rpmvercmp (const std::string &a, const std::string &b) const
void xconstruct (type_enum xtype, unsigned epoch, const std::string &v, const std::string &r, time_t buildtime)

Private Attributes

type_enum _type
unsigned _epoch
std::string _version
std::string _release
time_t _buildtime

Static Private Attributes

const std::string _str_UNSPEC
const std::string _str_MAXIMUM

Friends

std::ostream & operator<< (std::ostream &, const PkgEdition &)


Detailed Description

PkgEdition represents [epoch:]version[-release].

Syntax for specifying a PkgEdition:

[epoch:]version[-release]

epoch (optional) number, with assumed default of 0 if not supplied version (required) can contain any character except '-' release (optional) can contain any character except '-'

PkgEdition can also represent the special editions MAXIMUM (greater than all real editions) and UNSPEC (uncomparable).

PkgEdition may also contain a buildtime (optional, default of 0). On comparing PkgEditions the buildtime is taken into account, iff PkgEditions are equal and both contain a nonzero buildtime.


Member Enumeration Documentation

enum PkgEdition::type_enum
 

Enumeration values:
NORMAL 
MAXIMUM 
UNSPEC 


Constructor & Destructor Documentation

PkgEdition::PkgEdition type_enum  t = NORMAL  )  [inline]
 

Constructor

See also:
xconstruct

PkgEdition::PkgEdition const std::string &  v,
const std::string &  r = "",
time_t  bt = 0
[inline]
 

Constructor

See also:
xconstruct

PkgEdition::PkgEdition const std::string &  v,
time_t  bt
[inline]
 

Constructor

See also:
xconstruct

PkgEdition::PkgEdition unsigned  e,
const std::string &  v,
const std::string &  r = "",
time_t  bt = 0
[inline]
 

Constructor

See also:
xconstruct

PkgEdition::PkgEdition unsigned  e,
const std::string &  v,
time_t  bt
[inline]
 

Constructor

See also:
xconstruct

PkgEdition::~PkgEdition  )  [inline]
 


Member Function Documentation

string PkgEdition::asString  )  const
 

time_t PkgEdition::buildtime  )  const [inline]
 

bool PkgEdition::compare rel_op  op,
const PkgEdition e2
const
 

bool PkgEdition::edition_eq const PkgEdition e2  )  const [private]
 

bool PkgEdition::edition_lt const PkgEdition e2  )  const [private]
 

int PkgEdition::epoch  )  const [inline]
 

PkgEdition PkgEdition::fromString std::string  s  )  [static]
 

Restore PkgEdition from string (on restore from file). Keep it compatible with toString.

bool PkgEdition::has_epoch  )  const [inline]
 

bool PkgEdition::is_maximum  )  const [inline]
 

bool PkgEdition::is_unspecified  )  const [inline]
 

bool PkgEdition::operator!= const PkgEdition e2  )  const [inline]
 

bool PkgEdition::operator< const PkgEdition e2  )  const [inline]
 

bool PkgEdition::operator<= const PkgEdition e2  )  const [inline]
 

bool PkgEdition::operator== const PkgEdition e2  )  const [inline]
 

bool PkgEdition::operator> const PkgEdition e2  )  const [inline]
 

bool PkgEdition::operator>= const PkgEdition e2  )  const [inline]
 

const std::string& PkgEdition::release  )  const [inline]
 

int PkgEdition::rpmvercmp const std::string &  a,
const std::string &  b
const [private]
 

Return -1,0,1 if versions are <,==,>

string PkgEdition::toString const PkgEdition t  )  [static]
 

Convert PkgEdition to string (on save to file). Keep it compatible with fromString.

const std::string& PkgEdition::version  )  const [inline]
 

void PkgEdition::xconstruct type_enum  xtype,
unsigned  epoch,
const std::string &  v,
const std::string &  r,
time_t  buildtime
[private]
 

Helper for Constructor

String form for an edition is [epoch:]version-release, where (optional) epoch is a number, and neither version nor release may contain a '-'. This form may be passed to the version string v.

In constructors providing an 'int e' epoch value, an epoch part within the version string v is not allowed (ignored).

In constructors providing an nonempty release string r, a release part within the version string v is not allowed (ignored).

Construct PkgEdition: epoch 3, version 1.0 release 1 PkgEdition( "3:1.0-1" ) PkgEdition( "3:1.0", "1" ) PkgEdition( 3, "1.0-1" ) PkgEdition( 3, "1.0", "1" )

Assert _version/_release are empty srings on MAXIMUM and UNSPEC type.


Friends And Related Function Documentation

std::ostream& operator<< std::ostream &  os,
const PkgEdition e
[friend]
 


Member Data Documentation

time_t PkgEdition::_buildtime [private]
 

unsigned PkgEdition::_epoch [private]
 

std::string PkgEdition::_release [private]
 

const std::string PkgEdition::_str_MAXIMUM [static, private]
 

const std::string PkgEdition::_str_UNSPEC [static, private]
 

type_enum PkgEdition::_type [private]
 

std::string PkgEdition::_version [private]
 


The documentation for this class was generated from the following files:
Generated on Fri Nov 9 14:30:32 2007 for yast2-packagemanager by doxygen 1.3.6