apt  2.2.4
About: Apt (Advanced Package Tool) is a management system for software packages (Debian/Ubuntu). Release series 2.2.
  Fossies Dox: apt-2.2.4.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

APT::Configuration Namespace Reference

Classes

struct  Compressor
 Representation of supported compressors. More...
 

Functions

APT_PUBLIC std::vector< std::string > const getCompressionTypes (bool const &Cached=true)
 Returns a vector of usable Compression Types. More...
 
APT_PUBLIC 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. More...
 
APT_PUBLIC bool checkLanguage (std::string Lang, bool const All=false)
 Are we interested in the given Language? More...
 
APT_PUBLIC std::vector< std::string > const getArchitectures (bool const &Cached=true)
 Returns a vector of Architectures we support. More...
 
APT_PUBLIC bool checkArchitecture (std::string const &Arch)
 Are we interested in the given Architecture? More...
 
APT_PUBLIC std::vector< Compressor > const getCompressors (bool const Cached=true)
 Return a vector of Compressors supported for data.tar's. More...
 
APT_PUBLIC std::vector< std::string > const getCompressorExtensions ()
 Return a vector of extensions supported for data.tar's. More...
 
APT_PUBLIC std::vector< std::string > const getBuildProfiles ()
 
APT_PUBLIC std::string const getBuildProfilesString ()
 
std::string const getMachineID ()
 
bool isChroot ()
 

Function Documentation

◆ checkArchitecture()

APT_PUBLIC bool APT::Configuration::checkArchitecture ( std::string const &  Arch)

Are we interested in the given Architecture?

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

Referenced by IndexCopy::ConvertToSourceList(), pkgCdrom::DropBinaryArch(), pkgArchiveCleaner::Go(), pkgCacheGenerator::NewPackage(), pkgCacheListParser::NewProvidesAllArch(), and debListParser::ParseProvides().

◆ checkLanguage()

APT_PUBLIC bool APT::Configuration::checkLanguage ( std::string  Lang,
bool const  All = false 
)

Are we interested in the given Language?

Parameters
Langis the language we want to check
Alldefines if we check against all codes or only against used codes
Returns
true if we are interested, false otherwise

Referenced by pkgCdrom::DropTranslation().

◆ getArchitectures()

APT_PUBLIC std::vector<std::string> const APT::Configuration::getArchitectures ( bool const &  Cached = true)

Returns a vector of Architectures we support.

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

Referenced by canNotFindPkgName_impl(), DoBuildDep(), main(), CompareProviders::operator()(), debSLTypeDebian::parsePlusMinusArchOptions(), pkgCache< Str, Itr >::pkgCache(), pkgCache< Str, Itr >::ReMap(), pkgCacheGenerator::Start(), CacheSetHelperAPTGet::tryVirtualPackage(), EIPP::WriteRequest(), EDSP::WriteRequest(), EIPP::WriteScenario(), and EDSP::WriteScenario().

◆ getBuildProfiles()

APT_PUBLIC std::vector<std::string> const APT::Configuration::getBuildProfiles ( )
Returns
Return a vector of enabled build profile specifications

Referenced by main(), and debListParser::ParseDepends().

◆ getBuildProfilesString()

APT_PUBLIC std::string const APT::Configuration::getBuildProfilesString ( )
Returns
Return a comma-separated list of enabled build profile specifications

Referenced by DoSource().

◆ getCompressionTypes()

APT_PUBLIC std::vector<std::string> const APT::Configuration::getCompressionTypes ( bool const &  Cached = true)

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 only be used for testing purposes.
Returns
a vector of the compression types in the preferred usage order

Referenced by DoUpdate(), fileNameMatches(), GetIndexTargetsFor(), and pkgAcqDiffIndex::pkgAcqDiffIndex().

◆ getCompressorExtensions()

APT_PUBLIC std::vector<std::string> const APT::Configuration::getCompressorExtensions ( )

◆ getCompressors()

APT_PUBLIC std::vector<Compressor> const APT::Configuration::getCompressors ( bool const  Cached = true)

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 only be used for testing purposes.
Returns
a vector of Compressors

Referenced by IndexCopy::CopyPackages(), TranslationsCopy::CopyTranslations(), DoCatFile(), pkgCdrom::DropRepeats(), debDebFile::ExtractTarMember(), pkgCdrom::FindPackages(), GetIndexTargetsFor(), MultiCompress::GetStat(), main(), MultiCompress::MultiCompress(), FileFd::Open(), FileFd::OpenDescriptor(), OpenFileWithCompressorByName(), and ExtractTar::StartGzip().

◆ getLanguages()

APT_PUBLIC std::vector<std::string> const APT::Configuration::getLanguages ( bool const &  All = false,
bool const &  Cached = true,
char const **const  Locale = 0 
)

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 preferred 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 preferred 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 only be used for testing purposes.
Localedon't get the locale from the system but use this one instead this parameter should only be used for testing purposes.
Returns
a vector of (all) Language Codes in the preferred usage order

Referenced by debListParser::AvailableDescriptionLanguages(), debSLTypeDebian::CreateItemInternal(), debRecordParserBase::LongDesc(), main(), and TranslatedDescriptionsList().

◆ getMachineID()

std::string const APT::Configuration::getMachineID ( )

Referenced by pkgPolicy::pkgPolicy().

◆ isChroot()

bool APT::Configuration::isChroot ( )
Returns
Whether we are running in a chroot

Referenced by ExcludePhased().