Public Member Functions | Protected Attributes

ept::apt::Version Class Reference

Lightweight Version class that represent a package with a version, with very cheap value copy operations. More...

#include <version.h>

List of all members.

Public Member Functions

 Version ()
 Create an invalid Version.
 Version (const std::string &name, const std::string &version)
 Create a Version from strings.
std::string name () const
 Return the package name.
std::string version () const
 Return the package version, or the empty string if this is a versionless package.
std::string upstreamVersion () const
 Return the upstream part of the version.
bool isValid () const
 Return true if this package contains a valid value.
bool operator== (const Version &pkg) const
 Comparison operators.
bool operator!= (const Version &pkg) const
bool operator<= (const Version &pkg) const
bool operator< (const Version &pkg) const
bool operator>= (const Version &pkg) const
bool operator> (const Version &pkg) const

Protected Attributes

std::string m_name
std::string m_version

Detailed Description

Lightweight Version class that represent a package with a version, with very cheap value copy operations.

This class can be used to query package information from various information sources. The purpose is create a middle ground that makes sure that all sort of different information sources about packages are referring to the same package.


Constructor & Destructor Documentation

ept::apt::Version::Version (  )  [inline]

Create an invalid Version.

ept::apt::Version::Version ( const std::string &  name,
const std::string &  version 
) [inline]

Create a Version from strings.


Member Function Documentation

bool ept::apt::Version::isValid (  )  const [inline]

Return true if this package contains a valid value.

References m_name, and m_version.

Referenced by TestAptVersion::basic(), TestAptVersion::invalid(), TestApt::rawRecord(), and TestApt::versions().

std::string ept::apt::Version::name (  )  const [inline]
bool ept::apt::Version::operator!= ( const Version pkg  )  const [inline]

References m_name, and m_version.

bool ept::apt::Version::operator< ( const Version pkg  )  const

References name(), and version().

bool ept::apt::Version::operator<= ( const Version pkg  )  const

References name(), and version().

bool ept::apt::Version::operator== ( const Version pkg  )  const [inline]

Comparison operators.

References m_name, and m_version.

bool ept::apt::Version::operator> ( const Version pkg  )  const

References name(), and version().

bool ept::apt::Version::operator>= ( const Version pkg  )  const

References name(), and version().

std::string ept::apt::Version::upstreamVersion (  )  const

Return the upstream part of the version.

References m_version.

std::string ept::apt::Version::version (  )  const [inline]

Return the package version, or the empty string if this is a versionless package.

References m_version.

Referenced by TestAptVersion::basic(), TestAptVersion::invalid(), operator<(), operator<=(), operator>(), operator>=(), ept::apt::Apt::rawRecord(), and ept::apt::Apt::validate().


Member Data Documentation

std::string ept::apt::Version::m_name [protected]

Referenced by isValid(), name(), operator!=(), and operator==().

std::string ept::apt::Version::m_version [protected]

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