zypp::RepoInfo Class Reference

#include <RepoInfo.h>

List of all members.

Public Types

typedef unsigned long NumericId
typedef std::set< Urlurl_set
typedef
url_set::size_type 
urls_size_type
typedef
transform_iterator
< repo::RepoVariablesUrlReplacer,
url_set::const_iterator > 
urls_const_iterator

Public Member Functions

 RepoInfo ()
 ~RepoInfo ()
std::string alias () const
 unique identifier for this source.
ZYPP_DEPRECATED
std::set< Url
baseUrls () const
 A Url under which the metadata are located, or a set of mirrors.
Pathname path () const
Url mirrorListUrl () const
 Url of a file which contains a list of Urls If empty, the base url will be used.
urls_const_iterator baseUrlsBegin () const
 iterator that points at begin of repository urls
urls_const_iterator baseUrlsEnd () const
 iterator that points at end of repository urls
urls_size_type baseUrlsSize () const
 number of repository urls
bool baseUrlsEmpty () const
 whether repository urls are available
bool enabled () const
 If enabled is false, then this repository must be ignored as if does not exists, except when checking for duplicate alias.
bool autorefresh () const
 If true, the repostory must be refreshed before creating resolvables from it.
repo::RepoType type () const
 Type of repository,.
std::string name () const
Pathname filepath () const
Pathname metadataPath () const
bool gpgCheck () const
Url gpgKeyUrl () const
RepoInfoaddBaseUrl (const Url &url)
 Add a base url.
RepoInfosetBaseUrl (const Url &url)
 Clears current base URL list and adds url.
RepoInfosetPath (const Pathname &path)
 set the product path.
RepoInfosetMirrorListUrl (const Url &url)
 Set mirror list url.
RepoInfosetEnabled (bool enabled)
 enable or disable the repository
RepoInfosetAutorefresh (bool autorefresh)
 enable or disable autorefresh
RepoInfosetAlias (const std::string &alias)
 set the repository alias
RepoInfosetType (const repo::RepoType &t)
 set the repository type
RepoInfosetName (const std::string &name)
 set the repository name
RepoInfosetFilepath (const Pathname &filename)
RepoInfosetMetadataPath (const Pathname &path)
RepoInfosetGpgCheck (bool check)
RepoInfosetGpgKeyUrl (const Url &gpgkey)
std::ostream & dumpOn (std::ostream &str) const
 Write a human-readable representation of this RepoInfo object into the str stream.
std::ostream & dumpRepoOn (std::ostream &str) const
 Write this RepoInfo object into str in a

.repo file format.


Private Attributes

RWCOW_pointer< Impl_pimpl
 Pointer to implementation.

Friends

std::ostream & operator<< (std::ostream &str, const RepoInfo &obj)
 Stream output.

Classes

struct  Impl
 RepoInfo implementation. More...


Detailed Description

What is known about a repository The class RepoInfo represents everything that is known about a software repository.

It can be used to store information about known sources.

This class tries to be compatible with the concept of a .repo file used by YUM and also available in the openSUSE build service. See man yum.conf.

Example file

 [ruby]
 name=Ruby repository (openSUSE_10.2)
 type=rpm-md
 baseurl=http://software.opensuse.org/download/ruby/openSUSE_10.2/
 gpgcheck=1
 gpgkey=http://software.opensuse.org/openSUSE-Build-Service.asc
 enabled=1

Note:
A RepoInfo is a hint about how to create a Repository.

Definition at line 64 of file RepoInfo.h.


Member Typedef Documentation

typedef unsigned long zypp::RepoInfo::NumericId

Definition at line 72 of file RepoInfo.h.

typedef std::set<Url> zypp::RepoInfo::url_set

Definition at line 120 of file RepoInfo.h.

typedef url_set::size_type zypp::RepoInfo::urls_size_type

Definition at line 122 of file RepoInfo.h.

typedef transform_iterator<repo::RepoVariablesUrlReplacer, url_set::const_iterator> zypp::RepoInfo::urls_const_iterator

Definition at line 123 of file RepoInfo.h.


Constructor & Destructor Documentation

zypp::RepoInfo::RepoInfo (  ) 

Definition at line 83 of file RepoInfo.cc.

zypp::RepoInfo::~RepoInfo (  ) 

Definition at line 92 of file RepoInfo.cc.


Member Function Documentation

std::string zypp::RepoInfo::alias (  )  const

unique identifier for this source.

If not specified It should be generated from the base url.

Normally, in a .repo file the section name is used ( [somerepo] )

Definition at line 185 of file RepoInfo.cc.

References _pimpl.

Referenced by zypp::RepoManager::addRepository(), zypp::assert_alias(), zypp::RepoManager::buildCache(), zypp::RepoManager::cacheStatus(), zypp::RepoManager::checkIfToRefreshMetadata(), zypp::cleanCacheInternal(), zypp::RepoManager::createFromCache(), dumpOn(), dumpRepoOn(), zypp::generate_filename(), zypp::RepoManager::getRepositoryInfo(), zypp::RepoManager::isCached(), zypp::RepoManager::modifyRepository(), name(), zypp::operator<(), zypp::target::operator<<(), zypp::operator<<(), zypp::operator==(), zypp::repo::RepoMediaAccess::provideFile(), zypp::rawcache_path_for_repoinfo(), zypp::RepoManager::removeRepository(), zypp::repo::RepoMediaAccess::Impl::setVerifierForRepo(), zypp::solver::detail::ResolverInfo::toString(), and zypp::repo::cached::RepoImpl::~RepoImpl().

std::set< Url > zypp::RepoInfo::baseUrls (  )  const

A Url under which the metadata are located, or a set of mirrors.

This can't be empty in order the repository to be valid unless the download of the mirror list succeeds and it contains a valid url.

Deprecated:
IMO superfluous as we provide begin/end iterator.

Definition at line 214 of file RepoInfo.cc.

References _pimpl.

Pathname zypp::RepoInfo::path (  )  const

Repository path Pathname relative to the base Url where the product/repository is located For medias containing more than one product, or repositories not located at the root of the media it is important to know the path of the media root relative to the product directory so a media verifier can be set for that media.

It is not mandatory, and the default is /

Note:
As a repository can have multiple Urls, the path is unique and the same for all Urls, so it is assumed all the Urls have the same media layout.

Definition at line 229 of file RepoInfo.cc.

References _pimpl.

Referenced by zypp::RepoManager::checkIfToRefreshMetadata(), dumpOn(), dumpRepoOn(), and zypp::RepoManager::refreshMetadata().

Url zypp::RepoInfo::mirrorListUrl (  )  const

Url of a file which contains a list of Urls If empty, the base url will be used.

Definition at line 208 of file RepoInfo.cc.

References _pimpl.

RepoInfo::urls_const_iterator zypp::RepoInfo::baseUrlsBegin (  )  const

iterator that points at begin of repository urls

Definition at line 232 of file RepoInfo.cc.

References _pimpl.

Referenced by zypp::RepoManager::addRepository(), zypp::repo::PackageProvider::doProvidePackage(), dumpOn(), zypp::repo::RepoMediaAccess::provideFile(), zypp::repo::PackageProvider::providePackage(), and zypp::RepoManager::refreshMetadata().

RepoInfo::urls_const_iterator zypp::RepoInfo::baseUrlsEnd (  )  const

iterator that points at end of repository urls

Definition at line 239 of file RepoInfo.cc.

References _pimpl.

Referenced by dumpOn(), zypp::repo::RepoMediaAccess::provideFile(), and zypp::RepoManager::refreshMetadata().

RepoInfo::urls_size_type zypp::RepoInfo::baseUrlsSize (  )  const

number of repository urls

Definition at line 246 of file RepoInfo.cc.

References _pimpl.

Referenced by zypp::RepoManager::addRepository().

bool zypp::RepoInfo::baseUrlsEmpty (  )  const

whether repository urls are available

Definition at line 249 of file RepoInfo.cc.

References _pimpl.

Referenced by zypp::assert_urls(), zypp::repo::PackageProvider::doProvidePackage(), zypp::repo::RepoMediaAccess::provideFile(), and zypp::repo::PackageProvider::providePackage().

bool zypp::RepoInfo::enabled (  )  const

If enabled is false, then this repository must be ignored as if does not exists, except when checking for duplicate alias.

Definition at line 176 of file RepoInfo.cc.

References _pimpl.

Referenced by zypp::RepoManager::addRepository(), dumpOn(), and dumpRepoOn().

bool zypp::RepoInfo::autorefresh (  )  const

If true, the repostory must be refreshed before creating resolvables from it.

Definition at line 179 of file RepoInfo.cc.

References _pimpl.

Referenced by dumpOn(), and dumpRepoOn().

repo::RepoType zypp::RepoInfo::type (  )  const

Type of repository,.

Definition at line 205 of file RepoInfo.cc.

References _pimpl.

Referenced by zypp::RepoManager::addRepository(), zypp::RepoManager::buildCache(), zypp::RepoManager::checkIfToRefreshMetadata(), dumpOn(), dumpRepoOn(), zypp::RepoManager::metadataStatus(), zypp::RepoManager::refreshMetadata(), and zypp::RepoManager::touchIndexFile().

std::string zypp::RepoInfo::name (  )  const

Repository short label Short label or description of the repository, to be used on the user interface. ie: "SUSE Linux 10.2 updates"

Definition at line 188 of file RepoInfo.cc.

References _pimpl, and alias().

Referenced by zypp::RepoManager::addRepository(), zypp::RepoManager::buildCache(), zypp::cleanCacheInternal(), zypp::RepoManager::createFromCache(), and zypp::RepoManager::removeRepository().

Pathname zypp::RepoInfo::filepath (  )  const

File where this repo was read from

Note:
could be an empty pathname for repo infos created in memory.

Definition at line 199 of file RepoInfo.cc.

References _pimpl.

Referenced by zypp::RepoManager::modifyRepository(), and zypp::RepoManager::removeRepository().

Pathname zypp::RepoInfo::metadataPath (  )  const

Path where this repo metadata was read from

Note:
could be an empty pathname for repo infos created in memory.

Definition at line 202 of file RepoInfo.cc.

References _pimpl.

Referenced by zypp::repo::RepoMediaAccess::Impl::setVerifierForRepo().

bool zypp::RepoInfo::gpgCheck (  )  const

Whether to check or not this repository with gpg

Note:
This is a just a hint to the application and can be ignored.

Definition at line 182 of file RepoInfo.cc.

References _pimpl.

Referenced by dumpOn(), and dumpRepoOn().

Url zypp::RepoInfo::gpgKeyUrl (  )  const

Key to use for gpg checking of this repository

Parameters:
url Url to the key in ASCII armored format
Note:
This is a just a hint to the application and can be ignored.

Definition at line 211 of file RepoInfo.cc.

References _pimpl.

Referenced by dumpOn(), and dumpRepoOn().

RepoInfo & zypp::RepoInfo::addBaseUrl ( const Url url  ) 

Add a base url.

See also:
baseUrls
Parameters:
url The base url for the repository.
To recreate the base URLs list, use setBaseUrl(const Url &) followed by addBaseUrl().

Definition at line 127 of file RepoInfo.cc.

References _pimpl.

Referenced by zypp::parser::repositories_in_file(), and setBaseUrl().

RepoInfo & zypp::RepoInfo::setBaseUrl ( const Url url  ) 

Clears current base URL list and adds url.

Definition at line 133 of file RepoInfo.cc.

References _pimpl, and addBaseUrl().

Referenced by zypp::RepoManager::getRepositoryInfo().

RepoInfo & zypp::RepoInfo::setPath ( const Pathname &  path  ) 

set the product path.

See also:
path()
Parameters:
path the path to the product

Definition at line 140 of file RepoInfo.cc.

References _pimpl.

Referenced by zypp::parser::repositories_in_file().

RepoInfo & zypp::RepoInfo::setMirrorListUrl ( const Url url  ) 

Set mirror list url.

See also:
mirrorListUrl
Parameters:
url The base url for the list

Definition at line 115 of file RepoInfo.cc.

References _pimpl.

Referenced by zypp::parser::repositories_in_file().

RepoInfo & zypp::RepoInfo::setEnabled ( bool  enabled  ) 

enable or disable the repository

See also:
enabled
Parameters:
enabled 

Definition at line 97 of file RepoInfo.cc.

References _pimpl.

Referenced by zypp::parser::repositories_in_file().

RepoInfo & zypp::RepoInfo::setAutorefresh ( bool  autorefresh  ) 

enable or disable autorefresh

See also:
autorefresh
Parameters:
enabled 

Definition at line 103 of file RepoInfo.cc.

References _pimpl.

Referenced by zypp::parser::repositories_in_file().

RepoInfo & zypp::RepoInfo::setAlias ( const std::string &  alias  ) 

set the repository alias

See also:
alias
Parameters:
alias 

Definition at line 146 of file RepoInfo.cc.

References _pimpl.

Referenced by zypp::RepoManager::getRepositoryInfo(), and zypp::parser::repositories_in_file().

RepoInfo & zypp::RepoInfo::setType ( const repo::RepoType t  ) 

set the repository type

See also:
type
Parameters:
t 

Definition at line 152 of file RepoInfo.cc.

References _pimpl.

Referenced by zypp::RepoManager::addRepository(), and zypp::parser::repositories_in_file().

RepoInfo & zypp::RepoInfo::setName ( const std::string &  name  ) 

set the repository name

See also:
name
Parameters:
name 

Definition at line 158 of file RepoInfo.cc.

References _pimpl.

Referenced by zypp::parser::repositories_in_file().

RepoInfo & zypp::RepoInfo::setFilepath ( const Pathname &  filename  ) 

set the path to the .repo file The path to the .repo file where this repository was defined, or empty if nowhere.

Parameters:
path File path

Definition at line 164 of file RepoInfo.cc.

References _pimpl.

Referenced by zypp::parser::repositories_in_file().

RepoInfo & zypp::RepoInfo::setMetadataPath ( const Pathname &  path  ) 

set the path where the local metadata is stored The path to the metadata of this repository was defined, or empty if nowhere.

Parameters:
path directory path

Definition at line 170 of file RepoInfo.cc.

References _pimpl.

RepoInfo & zypp::RepoInfo::setGpgCheck ( bool  check  ) 

Whether to check or not this repository with gpg

Parameters:
check true (check) or false (dont'check)
Note:
This is a just a hint to the application and can be ignored.

Definition at line 109 of file RepoInfo.cc.

References _pimpl.

Referenced by zypp::parser::repositories_in_file().

RepoInfo & zypp::RepoInfo::setGpgKeyUrl ( const Url gpgkey  ) 

Key to use for gpg checking of this repository

Parameters:
url Url to the key in ASCII armored format
Note:
This is a just a hint to the application and can be ignored.

Definition at line 121 of file RepoInfo.cc.

References _pimpl.

Referenced by zypp::parser::repositories_in_file().

std::ostream & zypp::RepoInfo::dumpOn ( std::ostream &  str  )  const

Write a human-readable representation of this RepoInfo object into the str stream.

Useful for logging.

Definition at line 252 of file RepoInfo.cc.

References alias(), autorefresh(), baseUrlsBegin(), baseUrlsEnd(), enabled(), gpgCheck(), gpgKeyUrl(), path(), and type().

Referenced by zypp::operator<<().

std::ostream & zypp::RepoInfo::dumpRepoOn ( std::ostream &  str  )  const

Write this RepoInfo object into str in a

.repo file format.

Definition at line 273 of file RepoInfo.cc.

References _pimpl, alias(), zypp::ui::asString(), zypp::repo::RepoType::asString(), autorefresh(), enabled(), gpgCheck(), gpgKeyUrl(), path(), and type().

Referenced by zypp::RepoManager::addRepository(), and zypp::RepoManager::modifyRepository().


Friends And Related Function Documentation

std::ostream & operator<< ( std::ostream &  str,
const RepoInfo obj 
) [friend]

Stream output.

Definition at line 304 of file RepoInfo.cc.


Member Data Documentation

RWCOW_pointer<Impl> zypp::RepoInfo::_pimpl [private]

Pointer to implementation.

Definition at line 317 of file RepoInfo.h.

Referenced by addBaseUrl(), alias(), autorefresh(), baseUrls(), baseUrlsBegin(), baseUrlsEmpty(), baseUrlsEnd(), baseUrlsSize(), dumpRepoOn(), enabled(), filepath(), gpgCheck(), gpgKeyUrl(), metadataPath(), mirrorListUrl(), name(), path(), setAlias(), setAutorefresh(), setBaseUrl(), setEnabled(), setFilepath(), setGpgCheck(), setGpgKeyUrl(), setMetadataPath(), setMirrorListUrl(), setName(), setPath(), setType(), and type().


The documentation for this class was generated from the following files:
Generated on Tue Sep 25 19:23:16 2007 for libzypp by  doxygen 1.5.3