apt @VERSION@
Classes | Static Public Member Functions

Configuration Class Reference

Provide access methods to various configuration settings. More...

#include <aptconfiguration.h>

List of all members.

Classes

struct  Compressor
 Representation of supported compressors. More...

Static Public Member Functions

static std::vector
< std::string > const 
getCompressionTypes (bool const &Cached=true)
 Returns a vector of usable Compression Types.
static std::vector
< std::string > const 
getLanguages (bool const &All=false, bool const &Cached=true, char const **const Locale=0)
 Returns a vector of Language Codes.
static std::vector
< std::string > const 
getArchitectures (bool const &Cached=true)
 Returns a vector of Architectures we support.
static bool const checkArchitecture (std::string const &Arch)
 Are we interested in the given Architecture?
static std::vector< Compressor >
const 
getCompressors (bool const Cached=true)
 Return a vector of Compressors supported for data.tar's.
static std::vector
< std::string > const 
getCompressorExtensions ()
 Return a vector of extensions supported for data.tar's.

Detailed Description

Provide access methods to various configuration settings.

This class and their methods providing a layer around the usual access methods with _config to ensure that settings are correct and to be able to set defaults without the need to recheck it in every method again.


Member Function Documentation

bool const checkArchitecture ( std::string const &  Arch) [static]

Are we interested in the given Architecture?

Parameters:
Archwe want to check
Returns:
true if we are interested, false otherwise

References Configuration::getArchitectures().

std::vector< std::string > const getArchitectures ( bool const &  Cached = true) [static]

Returns a vector of Architectures we support.

Parameters:
Cachedsaves the result so we need to calculated it only once this parameter should ony be used for testing purposes.
Returns:
a vector of Architectures in prefered order

Referenced by Configuration::checkArchitecture(), pkgCache::GrpIterator::FindPreferredPkg(), and PackageSet::FromRegEx().

std::vector< std::string > const getCompressionTypes ( bool const &  Cached = true) [static]

Returns a vector of usable Compression Types.

Files can be compressed in various ways to decrease the size of the download. Therefore the Acquiremethods support a few compression types and some archives provide also a few different types. This option group exists to give the user the choice to prefer one type over the other (some compression types are very resource intensive - great if you have a limited download, bad if you have a really lowpowered hardware.)

This method ensures that the defaults are set and checks at runtime if the type can be used. E.g. the current default is to prefer bzip2 over lzma and gz - if the bzip2 binary is not available it has not much sense in downloading the bz2 file, therefore we will not return bz2 as a usable compression type. The availability is checked with the settings in the Dir::Bin group.

Parameters:
Cachedsaves the result so we need to calculated it only once this parameter should ony be used for testing purposes.
Returns:
a vector of (all) Language Codes in the prefered usage order
std::vector< APT::Configuration::Compressor > const getCompressors ( bool const  Cached = true) [static]

Return a vector of Compressors supported for data.tar's.

Parameters:
Cachedsaves the result so we need to calculated it only once this parameter should ony be used for testing purposes.
Returns:
a vector of Compressors

Referenced by Configuration::getCompressorExtensions().

std::vector< std::string > const getLanguages ( bool const &  All = false,
bool const &  Cached = true,
char const **const  Locale = 0 
) [static]

Returns a vector of Language Codes.

Languages can be defined with their two or five chars long code. This methods handles the various ways to set the prefered codes, honors the environment and ensures that the codes are not listed twice.

The special word "environment" will be replaced with the long and the short code of the local settings and it will be insured that this will not add duplicates. So in an german local the setting "environment, de_DE, en, de" will result in "de_DE, de, en".

Another special word is "none" which separates the prefered from all codes in this setting. So setting and method can be used to get codes the user want to see or to get all language codes APT (should) have Translations available.

Parameters:
Allreturn all codes or only codes for languages we want to use
Cachedsaves the result so we need to calculated it only once this parameter should ony be used for testing purposes.
Localedon't get the locale from the system but use this one instead this parameter should ony be used for testing purposes.
Returns:
a vector of (all) Language Codes in the prefered usage order

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