libzypp: zypp::ServiceInfo Class Reference

libzypp 17.38.14

zypp::ServiceInfo Class Reference

Service data. More...

`#include <zypp/ServiceInfo.h>`

Inheritance diagram for zypp::ServiceInfo:

## Classes
struct | RepoState
struct | Impl

## 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.
| ~ServiceInfo () override
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 ()
| RepoInfoBase (const RepoInfoBase &)=default
| RepoInfoBase (RepoInfoBase &&) noexcept=default
RepoInfoBase & | operator= (const RepoInfoBase &)=default
RepoInfoBase & | operator= (RepoInfoBase &&) noexcept=default
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.

## Static Public Attributes
static const ServiceInfo noService | ZYPP_API
| Represents an empty service.

## 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.
using | ReposToEnable = std::set<std::string>
| 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.
using | ReposToDisable = std::set<std::string>
| 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.
using | RepoStates = std::map<std::string, RepoState>
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.
std::ostream & | dumpAsIniOn (std::ostream &str) const override
| Writes ServiceInfo to stream in ".service" format.
std::ostream & | dumpAsXmlOn (std::ostream &str, const std::string &content="") const override
| Write an XML representation of this ServiceInfo object.

## Detailed Description

Service data.

Note
  Name and Url are subject to repo variable replacement (

See also
  RepoVariablesStringReplacer).

Definition at line 36 of file ServiceInfo.h.

## Member Typedef Documentation

## ◆ ReposToEnable

using zypp::ServiceInfo::ReposToEnable = std::set<std::string>

Container of repos.

Definition at line 115 of file ServiceInfo.h.

## ◆ ReposToDisable

using zypp::ServiceInfo::ReposToDisable = std::set<std::string>

Container of repos.

Definition at line 141 of file ServiceInfo.h.

## ◆ RepoStates

using zypp::ServiceInfo::RepoStates = std::map<std::string, RepoState>

Definition at line 185 of file ServiceInfo.h.

## Constructor & Destructor Documentation

## ◆ ServiceInfo() [1/3]

zypp::ServiceInfo::ServiceInfo | ( |  | ) |

Default ctor creates noService.

Definition at line 89 of file ServiceInfo.cc.

## ◆ ServiceInfo() [2/3]

zypp::ServiceInfo::ServiceInfo | ( | const std::string & | alias | ) |

Creates ServiceInfo with specified alias.

Parameters

  alias | unique short name of service

Definition at line 91 of file ServiceInfo.cc.

## ◆ ServiceInfo() [3/3]

zypp::ServiceInfo::ServiceInfo | ( | const std::string & | alias,
|  | const Url & | url )

ServiceInfo with alias and its URL.

Parameters

  alias | unique shortname of service
  url | url to service

Definition at line 95 of file ServiceInfo.cc.

## ◆ ~ServiceInfo()

zypp::ServiceInfo::~ServiceInfo | ( |  | ) |
| override

Definition at line 99 of file ServiceInfo.cc.

## Member Function Documentation

## ◆ url()

Url zypp::ServiceInfo::url | ( |  | ) | const

The service url.

Definition at line 102 of file ServiceInfo.cc.

## ◆ rawUrl()

Url zypp::ServiceInfo::rawUrl | ( |  | ) | const

The service raw url (no variables replaced).

Definition at line 105 of file ServiceInfo.cc.

## ◆ setUrl()

void zypp::ServiceInfo::setUrl | ( | const Url & | url | ) |

Set the service url (raw value).

Definition at line 108 of file ServiceInfo.cc.

## ◆ type()

repo::ServiceType zypp::ServiceInfo::type | ( |  | ) | const

Service type.

Definition at line 111 of file ServiceInfo.cc.

## ◆ setType()

void zypp::ServiceInfo::setType | ( | const repo::ServiceType & | type | ) |

Set service type.

Definition at line 112 of file ServiceInfo.cc.

## ◆ setProbedType()

void zypp::ServiceInfo::setProbedType | ( | const repo::ServiceType & | t | ) | const

Lazy init service type.

Definition at line 113 of file ServiceInfo.cc.

## ◆ ttl()

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 115 of file ServiceInfo.cc.

## ◆ setTtl()

void zypp::ServiceInfo::setTtl | ( | Date::Duration | ttl_r | ) |

Set sugested TTL.

Definition at line 116 of file ServiceInfo.cc.

## ◆ setProbedTtl()

void zypp::ServiceInfo::setProbedTtl | ( | Date::Duration | ttl_r | ) | const

Lazy init sugested TTL.

Definition at line 117 of file ServiceInfo.cc.

## ◆ lrf()

Date zypp::ServiceInfo::lrf | ( |  | ) | const

Date of last refresh (if known).

Definition at line 119 of file ServiceInfo.cc.

## ◆ setLrf()

void zypp::ServiceInfo::setLrf | ( | Date | lrf_r | ) |

Set date of last refresh.

Definition at line 120 of file ServiceInfo.cc.

## ◆ reposToEnableEmpty()

bool zypp::ServiceInfo::reposToEnableEmpty | ( |  | ) | const

Definition at line 122 of file ServiceInfo.cc.

## ◆ reposToEnableSize()

ServiceInfo::ReposToEnable::size_type zypp::ServiceInfo::reposToEnableSize | ( |  | ) | const

Definition at line 123 of file ServiceInfo.cc.

## ◆ reposToEnableBegin()

ServiceInfo::ReposToEnable::const_iterator zypp::ServiceInfo::reposToEnableBegin | ( |  | ) | const

Definition at line 124 of file ServiceInfo.cc.

## ◆ reposToEnableEnd()

ServiceInfo::ReposToEnable::const_iterator zypp::ServiceInfo::reposToEnableEnd | ( |  | ) | const

Definition at line 125 of file ServiceInfo.cc.

## ◆ reposToEnable()

Iterable< ReposToEnable::const_iterator > zypp::ServiceInfo::reposToEnable | ( |  | ) | const
| inline

Definition at line 120 of file ServiceInfo.h.

## ◆ repoToEnableFind()

bool zypp::ServiceInfo::repoToEnableFind | ( | const std::string & | alias_r | ) | const

Whether `alias_r` is mentioned in ReposToEnable.

Definition at line 127 of file ServiceInfo.cc.

## ◆ addRepoToEnable()

void zypp::ServiceInfo::addRepoToEnable | ( | const std::string & | alias_r | ) |

Add `alias_r` to the set of ReposToEnable.

Definition at line 130 of file ServiceInfo.cc.

## ◆ delRepoToEnable()

void zypp::ServiceInfo::delRepoToEnable | ( | const std::string & | alias_r | ) |

Remove `alias_r` from the set of ReposToEnable.

Definition at line 136 of file ServiceInfo.cc.

## ◆ clearReposToEnable()

void zypp::ServiceInfo::clearReposToEnable | ( |  | ) |

Clear the set of ReposToEnable.

Definition at line 139 of file ServiceInfo.cc.

## ◆ reposToDisableEmpty()

bool zypp::ServiceInfo::reposToDisableEmpty | ( |  | ) | const

Definition at line 143 of file ServiceInfo.cc.

## ◆ reposToDisableSize()

ServiceInfo::ReposToDisable::size_type zypp::ServiceInfo::reposToDisableSize | ( |  | ) | const

Definition at line 144 of file ServiceInfo.cc.

## ◆ reposToDisableBegin()

ServiceInfo::ReposToDisable::const_iterator zypp::ServiceInfo::reposToDisableBegin | ( |  | ) | const

Definition at line 145 of file ServiceInfo.cc.

## ◆ reposToDisableEnd()

ServiceInfo::ReposToDisable::const_iterator zypp::ServiceInfo::reposToDisableEnd | ( |  | ) | const

Definition at line 146 of file ServiceInfo.cc.

## ◆ reposToDisable()

Iterable< ReposToDisable::const_iterator > zypp::ServiceInfo::reposToDisable | ( |  | ) | const
| inline

Definition at line 146 of file ServiceInfo.h.

## ◆ repoToDisableFind()

bool zypp::ServiceInfo::repoToDisableFind | ( | const std::string & | alias_r | ) | const

Whether `alias_r` is mentioned in ReposToDisable.

Definition at line 148 of file ServiceInfo.cc.

## ◆ addRepoToDisable()

void zypp::ServiceInfo::addRepoToDisable | ( | const std::string & | alias_r | ) |

Add `alias_r` to the set of ReposToDisable.

Definition at line 151 of file ServiceInfo.cc.

## ◆ delRepoToDisable()

void zypp::ServiceInfo::delRepoToDisable | ( | const std::string & | alias_r | ) |

Remove `alias_r` from the set of ReposToDisable.

Definition at line 157 of file ServiceInfo.cc.

## ◆ clearReposToDisable()

void zypp::ServiceInfo::clearReposToDisable | ( |  | ) |

Clear the set of ReposToDisable.

Definition at line 160 of file ServiceInfo.cc.

## ◆ repoStates()

const ServiceInfo::RepoStates & zypp::ServiceInfo::repoStates | ( |  | ) | const

Access the remembered repository states.

Definition at line 164 of file ServiceInfo.cc.

## ◆ setRepoStates()

void zypp::ServiceInfo::setRepoStates | ( | RepoStates | newStates_r | ) |

Remember a new set of repository states.

Definition at line 165 of file ServiceInfo.cc.

## ◆ dumpAsIniOn()

std::ostream & zypp::ServiceInfo::dumpAsIniOn | ( | std::ostream & | str | ) | const
| overridevirtual

Writes ServiceInfo to stream in ".service" format.

Parameters

  str | stream where serialized version service is written

Reimplemented from zypp::repo::RepoInfoBase.

Definition at line 176 of file ServiceInfo.cc.

## ◆ dumpAsXmlOn()

std::ostream & zypp::ServiceInfo::dumpAsXmlOn | ( | std::ostream & | str,
|  | const std::string & | content = "" ) const
| overridevirtual

Write an XML representation of this ServiceInfo object.

Parameters

  str |
  content | if not empty, produces <service ...>content</service> otherwise <service .../>

Reimplemented from zypp::repo::RepoInfoBase.

Definition at line 213 of file ServiceInfo.cc.

## Member Data Documentation

## ◆ ZYPP_API

const ServiceInfo noService zypp::ServiceInfo::ZYPP_API
| static

Represents an empty service.

Definition at line 61 of file ServiceInfo.h.

## ◆ _pimpl

RWCOW_pointer<Impl> zypp::ServiceInfo::_pimpl
| private

Definition at line 214 of file ServiceInfo.h.

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

- zypp/ServiceInfo.h
- zypp/ServiceInfo.cc