16#include <zypp-core/base/DefaultIntegral>
63 if (
_type == repo::ServiceType::NONE
64 &&
type_r != repo::ServiceType::NONE )
76 {
return new Impl( *
this ); }
92 : repo::RepoInfoBase(alias), _pimpl(
new Impl() )
96 : repo::RepoInfoBase(alias), _pimpl(
new Impl(url) )
103 {
return _pimpl->_url.transformed(); }
106 {
return _pimpl->_url.raw(); }
140 {
_pimpl->_reposToEnable.clear(); }
161 {
_pimpl->_reposToDisable.clear(); }
171 <<
"enabled=" <<
obj.enabled <<
" "
172 <<
"autorefresh=" <<
obj.autorefresh <<
" "
173 <<
"priority=" <<
obj.priority;
178 RepoInfoBase::dumpAsIniOn(
str)
180 <<
"type = " <<
type() << endl;
183 str <<
"ttl_sec = " <<
ttl() << endl;
193 std::string tag(
"repo_" );
197 str << tag <<
"=" <<
el.first << endl
198 << tag <<
"_enabled=" << state.
enabled << endl
199 << tag <<
"_autorefresh=" << state.
autorefresh << endl;
202 << tag <<
"_priority=" << state.
priority << endl;
217 <<
" alias=\"" << escape(
alias()) <<
"\""
218 <<
" name=\"" << escape(
name()) <<
"\""
219 <<
" enabled=\"" <<
enabled() <<
"\""
223 <<
" ttl_sec=\"" <<
ttl() <<
"\"";
228 str <<
">" << endl << content <<
"</service>" << endl;
236 return obj.dumpAsIniOn(
str);
base::ValueTransform< Url, repo::RepoVariablesUrlReplacer > RepoVariablesReplacedUrl
Helper managing repo variables replaced urls.
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
Store and operate on date (time_t).
std::string asSeconds() const
Convert to string representation of calendar time in numeric form (like "1029255142").
static unsigned defaultPriority()
The default priority (99).
void setProbedTtl(Date::Duration ttl_r) const
Lazy init sugested TTL.
ReposToEnable::size_type reposToEnableSize() const
repo::ServiceType type() const
Service type.
ReposToEnable::const_iterator reposToEnableBegin() const
Date::Duration ttl() const
Sugested TTL between two metadata auto-refreshs.
void setLrf(Date lrf_r)
Set date of last refresh.
void setType(const repo::ServiceType &type)
Set service type.
Date lrf() const
Date of last refresh (if known).
bool repoToDisableFind(const std::string &alias_r) const
Whether alias_r is mentioned in ReposToDisable.
bool repoToEnableFind(const std::string &alias_r) const
Whether alias_r is mentioned in ReposToEnable.
const RepoStates & repoStates() const
Access the remembered repository states.
ReposToDisable::const_iterator reposToDisableEnd() const
ServiceInfo()
Default ctor creates noService.
ReposToEnable::const_iterator reposToEnableEnd() const
std::set< std::string > ReposToDisable
Container of repos.
std::map< std::string, RepoState > RepoStates
void addRepoToDisable(const std::string &alias_r)
Add alias_r to the set of ReposToDisable.
void clearReposToEnable()
Clear the set of ReposToEnable.
void delRepoToDisable(const std::string &alias_r)
Remove alias_r from the set of ReposToDisable.
bool reposToEnableEmpty() const
Url url() const
The service url.
RWCOW_pointer< Impl > _pimpl
std::ostream & dumpAsIniOn(std::ostream &str) const override
Writes ServiceInfo to stream in ".service" format.
void setProbedType(const repo::ServiceType &t) const
Lazy init service type.
void setTtl(Date::Duration ttl_r)
Set sugested TTL.
Url rawUrl() const
The service raw url (no variables replaced)
void addRepoToEnable(const std::string &alias_r)
Add alias_r to the set of ReposToEnable.
void clearReposToDisable()
Clear the set of ReposToDisable.
std::set< std::string > ReposToEnable
Container of repos.
void setUrl(const Url &url)
Set the service url (raw value)
std::ostream & dumpAsXmlOn(std::ostream &str, const std::string &content="") const override
Write an XML representation of this ServiceInfo object.
ReposToDisable::const_iterator reposToDisableBegin() const
void delRepoToEnable(const std::string &alias_r)
Remove alias_r from the set of ReposToEnable.
ReposToDisable::size_type reposToDisableSize() const
void setRepoStates(RepoStates newStates_r)
Remember a new set of repository states.
bool reposToDisableEmpty() const
bool autorefresh() const
If true, the repostory must be refreshed before creating resolvables from it.
std::string name() const
Repository name.
bool enabled() const
If enabled is false, then this repository must be ignored as if does not exists, except when checking...
std::string alias() const
unique identifier for this source.
String related utilities and Regular expression matching.
std::string asString(const Url &url_r)
std::string joinEscaped(TIterator begin, TIterator end, const char sep_r=' ')
Join strings using separator sep_r, quoting or escaping the values.
std::string numstring(char n, int w=0)
ZYPP_API detail::EscapedString escape(const std::string &in_r)
Escape xml special charaters (& -> &; from IoBind library).
Easy-to use interface to the ZYPP dependency resolver.
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
std::string asString(const Patch::Category &obj)
ServiceInfo::ReposToDisable ReposToDisable
Impl(const Impl &)=default
Impl & operator=(Impl &&)=delete
Impl & operator=(const Impl &)=delete
ReposToDisable _reposToDisable
DefaultIntegral< Date::Duration, 0 > _ttl
RepoVariablesReplacedUrl _url
void setProbedType(const repo::ServiceType &type_r) const
Impl * clone() const
clone for RWCOW_pointer
ServiceInfo::ReposToEnable ReposToEnable
ReposToEnable _reposToEnable
Service type enumeration.
const std::string & asString() const