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

PackageVersion Class Reference

PackageVersion is the class that represents a version of a Package. More...

#include <packageversion.h>

Inheritance diagram for PackageVersion:

Package InstalledPackage List of all members.

Public Member Functions

 PackageVersion ()
 Constructor.
 PackageVersion (PMString version)
 Constructor with version.
 PackageVersion (const PackageVersion &copy)
 Copy constructor with PackageVersion.
 PackageVersion (const Package &copy)
 Copy constructor with Package.
virtual ~PackageVersion ()
 Destructor.
bool operator== (const PackageVersion &param)
 Equality operator.
bool operator!= (const PackageVersion &param)
 Non equality operator.
bool operator== (const Package &param)
 Equality operator - with Package.
bool operator!= (const Package &param)
 Non equality operator - with Package.
virtual Dbt GetKey ()
 Returns DB Key.
virtual Dbt GetData ()
 Returns DB Data.
virtual void ReadData (Dbt data)
 Reads DB Data.
virtual void ReadKey (Dbt key)
 Reads DB Key.
void ProcessMasking (PMString maskedString)
 Process the usual portage masking string.
void CalculateSize ()
 Open the versions digest file and calculate the size.
bool IsHardmasked (Keyword keyword)
 Returns true if is eHardMasked.
bool IsUnstable (Keyword keyword)
 Returns true if is eUnstable.
bool IsStable (Keyword keyword)
 Returns true if is eStable.
bool CheckVersionWithKeyword (Keyword keyword)
 Returns true if versionMaskedState complies with keyword.

Public Attributes

MaskedStates versionMaskedState
 Version's masked state on different archs.
PMString version
 Version.
PMString sourceUrl
 Url for sources.
PMString possibleVirtuals
 Possible virtuals this package provides, can be dependent on useflags.
PMString slot
 Slot version goes into.
PMString licence
 Licence.
PMString compileDepend
 Compile time dependencies ( usual portage string format ).
PMString runDepend
 Run time dependencies ( usual portage string format ).
PMString postDepend
 Post time dependencies ( usual portage string format ).
int fileSize
 Filesize needed to be downloaded for this version.

Detailed Description

PackageVersion is the main "object" class in the api. It contains all the information we know about a package before it becomes installed and as such, is a heavily used class.


Constructor & Destructor Documentation

PackageVersion::PackageVersion  ) 
 

Default constructor. Sets slot and filesize to be 0.

PackageVersion::PackageVersion PMString  version  ) 
 

Constructor that sets the version.

Parameters:
version The string form of the version number.

PackageVersion::PackageVersion const PackageVersion copy  ) 
 

Copy Constructor for PackageVersions.

Parameters:
copy The PackageVersion to make a copy of.

PackageVersion::PackageVersion const Package copy  ) 
 

Copy Constructor for Packages.

Parameters:
copy The Package to make a copy of.

PackageVersion::~PackageVersion  )  [virtual]
 

Destructor.


Member Function Documentation

void PackageVersion::CalculateSize  ) 
 

Calculates the size of the files needed from the digest files in the portage tree.

Exceptions:
PortageException(eFileStreamError,/usr/portage/category/name/files/digest-name-version) if there is an error with the stream.

bool PackageVersion::CheckVersionWithKeyword Keyword  keyword  ) 
 

Checks the keyword in the package version with the keyword supplied. Returns true if the package version is installable.

Parameters:
keyword The Keyword to check against.
Returns:
true if the PackageVersion is installable with the keyword supplied.

Dbt PackageVersion::GetData  )  [virtual]
 

Returns the Dbt data for this version. Used to store in the DB. Stores compileDepend, runDepend, postDepend, version, sourceUrl, licence, slot, fileSize,possibleVirtuals,versionMaskedState.

Returns:
The Dbt for the data to be stored in the PackageVersionDatabase.
Exceptions:
PortageException(eNotEnoughMem,category/name-version) if we run out of memory.

Reimplemented from Package.

Reimplemented in InstalledPackage.

Dbt PackageVersion::GetKey  )  [virtual]
 

Returns the Dbt key for this version. Used to store in the DB. Stores category and name.

Returns:
The Dbt for the key to be stored in the PackageVersionDatabase.
Exceptions:
PortageException(eNotEnoughMem,category/name-version) if we run out of memory.

Reimplemented from Package.

Reimplemented in InstalledPackage.

bool PackageVersion::IsHardmasked Keyword  keyword  ) 
 

Returns true if the package version is hardmasked on the arch detailed by keyword.

Parameters:
keyword The Keyword to check against.
Returns:
true if the PackageVersion is hardmasked.

bool PackageVersion::IsStable Keyword  keyword  ) 
 

Returns true if the package version is stable on the arch detailed by keyword.

Parameters:
keyword The Keyword to check against.
Returns:
true if the PackageVersion is stable.

bool PackageVersion::IsUnstable Keyword  keyword  ) 
 

Returns true if the package version is unstable on the arch detailed by keyword.

Parameters:
keyword The Keyword to check against.
Returns:
true if the PackageVersion is unstable.

bool PackageVersion::operator!= const Package param  ) 
 

Non Equality operator - with Package.

Parameters:
param The Package to test against.
Returns:
true if the Packages are not equal.

Reimplemented from Package.

Reimplemented in InstalledPackage.

bool PackageVersion::operator!= const PackageVersion param  ) 
 

Non Equality operator

Parameters:
param The PackageVersion to test against.
Returns:
true if the PackageVersions are not equal.

Reimplemented in InstalledPackage.

bool PackageVersion::operator== const Package param  ) 
 

Equality operator - with Package.

Parameters:
param The Package to test against.
Returns:
true if the Packages are equal.

Reimplemented from Package.

Reimplemented in InstalledPackage.

bool PackageVersion::operator== const PackageVersion param  ) 
 

Equality operator - with PackageVersion.

Parameters:
param The PackageVersion to test against.
Returns:
true if the two PackageVersions are equal.

Reimplemented in InstalledPackage.

void PackageVersion::ProcessMasking PMString  maskedString  ) 
 

Takes a string like the one found in the metadata cache and extracts the masking information.

Parameters:
maskedString The metadata style ~arch string.

void PackageVersion::ReadData Dbt  data  )  [virtual]
 

Reads the Data from a Dbt object. Used when extracting things from the DB.

Parameters:
data The Dbt data read from the PackageVersionDatabase.

Reimplemented from Package.

Reimplemented in InstalledPackage.

void PackageVersion::ReadKey Dbt  key  )  [virtual]
 

Reads the Key from a Dbt object. Used when extracting things from the DB.

Parameters:
key The Dbt key read from the PackageVersionDatabase.

Reimplemented from Package.

Reimplemented in InstalledPackage.


The documentation for this class was generated from the following files:
Generated on Wed May 25 15:29:54 2005 for Package Management System for Gentoo Linux by  doxygen 1.4.1