libzypp 17.31.23
|
Service data. More...
#include <ServiceInfo.h>
Classes | |
struct | Impl |
struct | RepoState |
Public Member Functions | |
ServiceInfo () | |
Default ctor creates noService. | |
ServiceInfo (const std::string &alias) | |
Creates ServiceInfo with specified alias. | |
ServiceInfo (const std::string &alias, const Url &url) | |
ServiceInfo with alias and its URL. | |
virtual | ~ServiceInfo () |
Url | url () const |
The service url. | |
Url | rawUrl () const |
The service raw url (no variables replaced) | |
void | setUrl (const Url &url) |
Set the service url (raw value) | |
repo::ServiceType | type () const |
Service type. | |
void | setType (const repo::ServiceType &type) |
Set service type. | |
void | setProbedType (const repo::ServiceType &t) const |
Lazy init service type. | |
Housekeeping data | |
You don't want to use the setters unless you are a RepoManager. | |
Date::Duration | ttl () const |
Sugested TTL between two metadata auto-refreshs. | |
void | setTtl (Date::Duration ttl_r) |
Set sugested TTL. | |
void | setProbedTtl (Date::Duration ttl_r) const |
Lazy init sugested TTL. | |
Date | lrf () const |
Date of last refresh (if known). | |
void | setLrf (Date lrf_r) |
Set date of last refresh. | |
Public Member Functions inherited from zypp::repo::RepoInfoBase | |
RepoInfoBase () | |
RepoInfoBase (const std::string &alias) | |
virtual | ~RepoInfoBase () |
std::string | alias () const |
unique identifier for this source. | |
std::string | escaped_alias () const |
Same as alias(), just escaped in a way to be a valid file name. | |
std::string | name () const |
Repository name. | |
std::string | rawName () const |
The raw metadata name (no default, no variables replaced). | |
std::string | label () const |
Label for use in messages for the user interface. | |
std::string | asUserString () const |
User string: label (alias or name) | |
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. | |
Pathname | filepath () const |
File where this repo was read from. | |
void | setAlias (const std::string &alias) |
set the repository alias | |
void | setName (const std::string &name) |
set the repository name | |
void | setEnabled (bool enabled) |
enable or disable the repository | |
void | setAutorefresh (bool autorefresh) |
enable or disable autorefresh | |
void | setFilepath (const Pathname &filename) |
set the path to the .repo file | |
virtual std::ostream & | dumpOn (std::ostream &str) const |
Write a human-readable representation of this RepoInfoBase object into the str stream. | |
virtual std::ostream & | dumpAsIniOn (std::ostream &str) const |
Write this RepoInfoBase object into str in a .repo (ini) file format. | |
virtual std::ostream & | dumpAsXmlOn (std::ostream &str, const std::string &content="") const |
Write an XML representation of this object with content (if available). | |
Static Public Attributes | |
static const ServiceInfo | noService |
Represents an empty service. | |
Related Functions | |
(Note that these are not member functions.) | |
typedef shared_ptr< ServiceInfo > | ServiceInfo_Ptr |
typedef shared_ptr< const ServiceInfo > | ServiceInfo_constPtr |
typedef std::list< ServiceInfo > | ServiceInfoList |
std::ostream & | operator<< (std::ostream &str, const ServiceInfo &obj) |
Stream output. | |
Related Functions inherited from zypp::repo::RepoInfoBase | |
typedef shared_ptr< RepoInfoBase > | RepoInfoBase_Ptr |
typedef shared_ptr< const RepoInfoBase > | RepoInfoBase_constPtr |
bool | operator== (const RepoInfoBase &lhs, const RepoInfoBase &rhs) |
bool | operator!= (const RepoInfoBase &lhs, const RepoInfoBase &rhs) |
std::ostream & | operator<< (std::ostream &str, const RepoInfoBase &obj) |
Stream output. | |
Set of repos (repository aliases) to enable on next refresh. | |
Per default new repositories are created in disabled state. But repositories mentioned here will be created in enabled state on the next refresh. Afterwards they get removed from the list. | |
typedef std::set< std::string > | ReposToEnable |
Container of repos. | |
bool | reposToEnableEmpty () const |
ReposToEnable::size_type | reposToEnableSize () const |
ReposToEnable::const_iterator | reposToEnableBegin () const |
ReposToEnable::const_iterator | reposToEnableEnd () const |
Iterable< ReposToEnable::const_iterator > | reposToEnable () const |
bool | repoToEnableFind (const std::string &alias_r) const |
Whether alias_r is mentioned in ReposToEnable. | |
void | addRepoToEnable (const std::string &alias_r) |
Add alias_r to the set of ReposToEnable. | |
void | delRepoToEnable (const std::string &alias_r) |
Remove alias_r from the set of ReposToEnable. | |
void | clearReposToEnable () |
Clear the set of ReposToEnable. | |
Set of repos (repository aliases) to disable on next refresh. | |
Repositories mentioned here will be disabled on the next refresh, in case they still exist. Afterwards they get removed from the list. | |
typedef std::set< std::string > | ReposToDisable |
Container of repos. | |
bool | reposToDisableEmpty () const |
ReposToDisable::size_type | reposToDisableSize () const |
ReposToDisable::const_iterator | reposToDisableBegin () const |
ReposToDisable::const_iterator | reposToDisableEnd () const |
Iterable< ReposToDisable::const_iterator > | reposToDisable () const |
bool | repoToDisableFind (const std::string &alias_r) const |
Whether alias_r is mentioned in ReposToDisable. | |
void | addRepoToDisable (const std::string &alias_r) |
Add alias_r to the set of ReposToDisable. | |
void | delRepoToDisable (const std::string &alias_r) |
Remove alias_r from the set of ReposToDisable. | |
void | clearReposToDisable () |
Clear the set of ReposToDisable. | |
The original repo state as defined by the repoindex.xml upon last refresh. | |
This state is remembered to detect any user modifications applied to the repos. It may not be available for all repos or in plugin services. In this case all changes requested by a service refresh are applied unconditionally. | |
typedef std::map< std::string, RepoState > | RepoStates |
RWCOW_pointer< Impl > | _pimpl |
const RepoStates & | repoStates () const |
Access the remembered repository states. | |
void | setRepoStates (RepoStates newStates_r) |
Remember a new set of repository states. | |
virtual std::ostream & | dumpAsIniOn (std::ostream &str) const |
Writes ServiceInfo to stream in ".service" format. | |
virtual std::ostream & | dumpAsXmlOn (std::ostream &str, const std::string &content="") const |
Write an XML representation of this ServiceInfo object. | |
Service data.
Definition at line 36 of file ServiceInfo.h.
typedef std::set<std::string> zypp::ServiceInfo::ReposToEnable |
Container of repos.
Definition at line 115 of file ServiceInfo.h.
typedef std::set<std::string> zypp::ServiceInfo::ReposToDisable |
Container of repos.
Definition at line 141 of file ServiceInfo.h.
typedef std::map<std::string,RepoState> zypp::ServiceInfo::RepoStates |
Definition at line 185 of file ServiceInfo.h.
zypp::ServiceInfo::ServiceInfo | ( | ) |
Default ctor creates noService.
Definition at line 86 of file ServiceInfo.cc.
zypp::ServiceInfo::ServiceInfo | ( | const std::string & | alias | ) |
Creates ServiceInfo with specified alias.
alias | unique short name of service |
Definition at line 88 of file ServiceInfo.cc.
zypp::ServiceInfo::ServiceInfo | ( | const std::string & | alias, |
const Url & | url | ||
) |
ServiceInfo with alias and its URL.
alias | unique shortname of service |
url | url to service |
Definition at line 92 of file ServiceInfo.cc.
|
virtual |
Definition at line 96 of file ServiceInfo.cc.
Url zypp::ServiceInfo::url | ( | ) | const |
The service url.
Definition at line 99 of file ServiceInfo.cc.
Url zypp::ServiceInfo::rawUrl | ( | ) | const |
The service raw url (no variables replaced)
Definition at line 102 of file ServiceInfo.cc.
void zypp::ServiceInfo::setUrl | ( | const Url & | url | ) |
Set the service url (raw value)
Definition at line 105 of file ServiceInfo.cc.
repo::ServiceType zypp::ServiceInfo::type | ( | ) | const |
Service type.
Definition at line 108 of file ServiceInfo.cc.
void zypp::ServiceInfo::setType | ( | const repo::ServiceType & | type | ) |
Set service type.
Definition at line 109 of file ServiceInfo.cc.
void zypp::ServiceInfo::setProbedType | ( | const repo::ServiceType & | t | ) | const |
Lazy init service type.
Definition at line 110 of file ServiceInfo.cc.
Date::Duration zypp::ServiceInfo::ttl | ( | ) | const |
Sugested TTL between two metadata auto-refreshs.
The value (in seconds) may be provided in repoindex.xml:xpath:/repoindex@ttl. Default is 0 - perform each auto-refresh request.
Definition at line 112 of file ServiceInfo.cc.
void zypp::ServiceInfo::setTtl | ( | Date::Duration | ttl_r | ) |
Set sugested TTL.
Definition at line 113 of file ServiceInfo.cc.
void zypp::ServiceInfo::setProbedTtl | ( | Date::Duration | ttl_r | ) | const |
Lazy init sugested TTL.
Definition at line 114 of file ServiceInfo.cc.
Date zypp::ServiceInfo::lrf | ( | ) | const |
Date of last refresh (if known).
Definition at line 116 of file ServiceInfo.cc.
void zypp::ServiceInfo::setLrf | ( | Date | lrf_r | ) |
Set date of last refresh.
Definition at line 117 of file ServiceInfo.cc.
bool zypp::ServiceInfo::reposToEnableEmpty | ( | ) | const |
Definition at line 119 of file ServiceInfo.cc.
ServiceInfo::ReposToEnable::size_type zypp::ServiceInfo::reposToEnableSize | ( | ) | const |
Definition at line 120 of file ServiceInfo.cc.
ServiceInfo::ReposToEnable::const_iterator zypp::ServiceInfo::reposToEnableBegin | ( | ) | const |
Definition at line 121 of file ServiceInfo.cc.
ServiceInfo::ReposToEnable::const_iterator zypp::ServiceInfo::reposToEnableEnd | ( | ) | const |
Definition at line 122 of file ServiceInfo.cc.
|
inline |
Definition at line 120 of file ServiceInfo.h.
bool zypp::ServiceInfo::repoToEnableFind | ( | const std::string & | alias_r | ) | const |
Whether alias_r
is mentioned in ReposToEnable.
Definition at line 124 of file ServiceInfo.cc.
void zypp::ServiceInfo::addRepoToEnable | ( | const std::string & | alias_r | ) |
Add alias_r
to the set of ReposToEnable.
Definition at line 127 of file ServiceInfo.cc.
void zypp::ServiceInfo::delRepoToEnable | ( | const std::string & | alias_r | ) |
Remove alias_r
from the set of ReposToEnable.
Definition at line 133 of file ServiceInfo.cc.
void zypp::ServiceInfo::clearReposToEnable | ( | ) |
Clear the set of ReposToEnable.
Definition at line 136 of file ServiceInfo.cc.
bool zypp::ServiceInfo::reposToDisableEmpty | ( | ) | const |
Definition at line 140 of file ServiceInfo.cc.
ServiceInfo::ReposToDisable::size_type zypp::ServiceInfo::reposToDisableSize | ( | ) | const |
Definition at line 141 of file ServiceInfo.cc.
ServiceInfo::ReposToDisable::const_iterator zypp::ServiceInfo::reposToDisableBegin | ( | ) | const |
Definition at line 142 of file ServiceInfo.cc.
ServiceInfo::ReposToDisable::const_iterator zypp::ServiceInfo::reposToDisableEnd | ( | ) | const |
Definition at line 143 of file ServiceInfo.cc.
|
inline |
Definition at line 146 of file ServiceInfo.h.
bool zypp::ServiceInfo::repoToDisableFind | ( | const std::string & | alias_r | ) | const |
Whether alias_r
is mentioned in ReposToDisable.
Definition at line 145 of file ServiceInfo.cc.
void zypp::ServiceInfo::addRepoToDisable | ( | const std::string & | alias_r | ) |
Add alias_r
to the set of ReposToDisable.
Definition at line 148 of file ServiceInfo.cc.
void zypp::ServiceInfo::delRepoToDisable | ( | const std::string & | alias_r | ) |
Remove alias_r
from the set of ReposToDisable.
Definition at line 154 of file ServiceInfo.cc.
void zypp::ServiceInfo::clearReposToDisable | ( | ) |
Clear the set of ReposToDisable.
Definition at line 157 of file ServiceInfo.cc.
const ServiceInfo::RepoStates & zypp::ServiceInfo::repoStates | ( | ) | const |
Access the remembered repository states.
Definition at line 161 of file ServiceInfo.cc.
void zypp::ServiceInfo::setRepoStates | ( | RepoStates | newStates_r | ) |
Remember a new set of repository states.
Definition at line 162 of file ServiceInfo.cc.
|
virtual |
Writes ServiceInfo to stream in ".service" format.
str | stream where serialized version service is written |
Reimplemented from zypp::repo::RepoInfoBase.
Definition at line 173 of file ServiceInfo.cc.
|
virtual |
Write an XML representation of this ServiceInfo object.
str | |
content | if not empty, produces <service ...>content</service> otherwise <service .../> |
Reimplemented from zypp::repo::RepoInfoBase.
Definition at line 210 of file ServiceInfo.cc.
|
related |
Definition at line 219 of file ServiceInfo.h.
|
related |
Definition at line 221 of file ServiceInfo.h.
|
related |
Definition at line 223 of file ServiceInfo.h.
|
related |
Stream output.
Definition at line 231 of file ServiceInfo.cc.
|
static |
Represents an empty service.
Definition at line 61 of file ServiceInfo.h.
|
private |
Definition at line 214 of file ServiceInfo.h.