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

Package Class Reference

The Package class. More...

#include <package.h>

Inheritance diagram for Package:

PackageVersion InstalledPackage List of all members.

Public Member Functions

 Package ()
 Default Constructor.
 Package (PMString description)
 Constructor - only supply the description, looks up other things.
 Package (PMString category, PMString name)
 Constructor - suppy name and category.
 Package (PMString category, PMString name, MaskedStatus state)
 Constructor - supply all info.
 Package (const Package &copy)
 Copy Constructor.
virtual ~Package ()
 Destructor.
bool operator== (const Package &param)
 Equality operator.
bool operator!= (const Package &param)
 Non equality operator.
virtual Dbt GetKey ()
 Return the Key used by DB.
virtual Dbt GetData ()
 Return the Data used by DB.
virtual void ReadData (Dbt data)
 Read the Data used by DB.
virtual void ReadKey (Dbt key)
 Read the Key used by DB.

Public Attributes

PMString name
 Package Name.
PMString category
 Package Category.
PMString url
 Package url.
PMString description
 Package description.
MaskedStatus packageMaskedState
 Masked State for this system, set by user.

Protected Member Functions

std::vector< PMString_GetInfo (PMString description)
 Given a description, returns vector of package info.
std::vector< PMString_FindCategories (PMString name)
 Given a name, returns a vector of possible categories.

Detailed Description

The Package class. Contains all the info specific to a package. Package Version inherits from this. Contains a few methods that should not be used if it can be helped.


Constructor & Destructor Documentation

Package::Package  ) 
 

Default constructor - sets the usual maskedState.

Package::Package PMString  description  ) 
 

Constructor that takes in a PMString in the form category/packagename-version. Throws the exceptions recieved by _GetInfo(). Will call _FindCategories if it is needed. Do not use this if you can help it as it does not use the DB and will be slow.

Parameters:
description A string description of the package, i.e cate/name-version.
Exceptions:
std::vector<PMString> of matching categories if there are more than one.

Package::Package PMString  category,
PMString  name
 

Constructor, takes in PMStrings for category and name.

Parameters:
category The category of the Package.
name The name of the Package.

Package::Package PMString  category,
PMString  name,
MaskedStatus  state
 

Constructor to fill in all the info using passed objects.

Parameters:
category The category of the Package.
name The name of the Package.
state The MaskedStatus of the Package.

Package::Package const Package copy  ) 
 

Copy constructor.

Parameters:
copy The Package to copy.

Package::~Package  )  [virtual]
 

Destructor.


Member Function Documentation

std::vector< PMString > Package::_FindCategories PMString  name  )  [protected]
 

Find the category referenced by name. Returns a vector of possible categories. Uses the directory structure at the moment and not the database. This is a speed issue and so this should be used sparingly where the database is not applicable.

Parameters:
name The name of the package to search for.
Returns:
A vector of matching categories.
Exceptions:
DirectoryException(scanf_error,directoryName) if scanf returns with an error.

std::vector< PMString > Package::_GetInfo PMString  description  )  [protected]
 

Takes a description and returns a vector with category name in ( at 0 and 1 respectively ). throws EInvalidDescription if it is recieved by GetCategory or GetName.

Parameters:
description The portage style description of a Package, i.e. cat/name-version
Returns:
A vector containing category, then name
Exceptions:
std::vector<PMString> of matching categories if there are more than one.

Dbt Package::GetData  )  [virtual]
 

Get the Data used by DB. Stores category, url, description and packageMaskedState.

Returns:
the Dbt data used in the PackageDatabase.
Exceptions:
PortageException(eNotEnoughMem,category/name-version) if we run out of memory.

Reimplemented in InstalledPackage, and PackageVersion.

Dbt Package::GetKey  )  [virtual]
 

Get the Key used by DB. Stores name and thats it.

Returns:
The Dbt key used in the PackageDatabase.
Exceptions:
PortageException(eNotEnoughMem,category/name-version) if we run out of memory.

Reimplemented in InstalledPackage, and PackageVersion.

bool Package::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 in InstalledPackage, and PackageVersion.

bool Package::operator== const Package param  ) 
 

Equality operator - with Package.

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

Reimplemented in InstalledPackage, and PackageVersion.

void Package::ReadData Dbt  data  )  [virtual]
 

Read the Data stored in the DB

Parameters:
data The Dbt data read from the PackageDatabase.

Reimplemented in InstalledPackage, and PackageVersion.

void Package::ReadKey Dbt  key  )  [virtual]
 

Read the Key stored in the DB.

Parameters:
key The Dbt key read from the PackageDatabase.

Reimplemented in InstalledPackage, and PackageVersion.


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