paludis  Version 1.4.2
Public Types | Public Member Functions | Friends | List of all members
paludis::VersionSpec Class Reference

#include <version_spec.hh>

+ Inheritance diagram for paludis::VersionSpec:

Public Types

typedef WrappedForwardIterator
< ConstIteratorTag, const

Public Member Functions

VersionSpec remove_revision () const
std::string revision_only () const
VersionSpec bump () const
bool is_scm () const
bool has_try_part () const
bool has_scm_part () const
bool has_local_revision () const
ConstIterator begin () const
ConstIterator end () const


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

Basic operations

 VersionSpec (const std::string &text, const VersionSpecOptions &options)
 VersionSpec (const VersionSpec &other)
 ~VersionSpec ()
const VersionSpecoperator= (const VersionSpec &other)
std::size_t hash () const PALUDIS_ATTRIBUTE((warn_unused_result))

Comparison operators

bool tilde_compare (const VersionSpec &other) const
bool tilde_greater_compare (const VersionSpec &other) const
bool nice_equal_star_compare (const VersionSpec &other) const
bool stupid_equal_star_compare (const VersionSpec &other) const
int compare (const VersionSpec &other) const
bool operator== (const VersionSpec &) const
bool operator< (const VersionSpec &) const

Detailed Description

A VersionSpec represents a version number (for example, 1.2.3b-r1).

Examples:, and

Constructor & Destructor Documentation

paludis::VersionSpec::VersionSpec ( const std::string &  text,
const VersionSpecOptions options 


paludis::VersionSpec::VersionSpec ( const VersionSpec other)

Copy constructor.

paludis::VersionSpec::~VersionSpec ( )


Member Function Documentation

VersionSpec paludis::VersionSpec::bump ( ) const

Bump ourself.

This is used by the ~> operator. It returns a version where the next to last number is one greater (e.g. 5.3.1 => 5.4). Any non number parts are stripped (e.g. 1.2.3_alpha4-r5 => 1.3).

int paludis::VersionSpec::compare ( const VersionSpec other) const

Compare to another version.

bool paludis::VersionSpec::has_local_revision ( ) const

Do we have a local revision (-r1.2...)?

bool paludis::VersionSpec::has_scm_part ( ) const

Do we have an -scm part?

Use is_scm() if -9999 etc is desired.

bool paludis::VersionSpec::has_try_part ( ) const

Do we have a -try part?

bool paludis::VersionSpec::is_scm ( ) const

Are we an -scm package, or something pretending to be one?

bool paludis::VersionSpec::nice_equal_star_compare ( const VersionSpec other) const

Comparison function for =* depend operator in sensible EAPIs.

const VersionSpec& paludis::VersionSpec::operator= ( const VersionSpec other)


VersionSpec paludis::VersionSpec::remove_revision ( ) const

Remove the revision part.

std::string paludis::VersionSpec::revision_only ( ) const

Revision part only (or "r0").

bool paludis::VersionSpec::stupid_equal_star_compare ( const VersionSpec other) const

Comparison function for =* depend operator in Gentooish EAPIs.

bool paludis::VersionSpec::tilde_compare ( const VersionSpec other) const

Comparison function for ~ depend operator.

bool paludis::VersionSpec::tilde_greater_compare ( const VersionSpec other) const

Comparison function for ~> depend operator (gems).

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  ,
const VersionSpec  

Output a VersionSpec to a stream.

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