16#include <zypp-core/base/DefaultIntegral>
63 if (
_type == repo::ServiceType::NONE
64 && type_r != repo::ServiceType::NONE )
76 {
return new Impl( *
this ); }
103 {
return _pimpl->_url.transformed(); }
106 {
return _pimpl->_url.raw(); }
128 {
return(
_pimpl->_reposToEnable.find( alias_r ) !=
_pimpl->_reposToEnable.end() ); }
132 _pimpl->_reposToEnable.insert( alias_r );
133 _pimpl->_reposToDisable.erase( alias_r );
137 {
_pimpl->_reposToEnable.erase( alias_r ); }
140 {
_pimpl->_reposToEnable.clear(); }
149 {
return(
_pimpl->_reposToDisable.find( alias_r ) !=
_pimpl->_reposToDisable.end() ); }
153 _pimpl->_reposToDisable.insert( alias_r );
154 _pimpl->_reposToEnable.erase( alias_r );
158 {
_pimpl->_reposToDisable.erase( alias_r ); }
161 {
_pimpl->_reposToDisable.clear(); }
171 <<
"enabled=" << obj.
enabled <<
" "
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;
219 <<
" enabled=\"" <<
enabled() <<
"\""
223 <<
" ttl_sec=\"" <<
ttl() <<
"\"";
228 str <<
">" << endl << content <<
"</service>" << endl;
ZYPP_API detail::EscapedString escape(const std::string &in_r)
Escape xml special charaters (& -> &; from IoBind library).
base::ValueTransform< Url, repo::RepoVariablesUrlReplacer > RepoVariablesReplacedUrl
Helper managing repo variables replaced urls.
Store and operate on date (time_t).
std::string asSeconds() const
Convert to string representation of calendar time in numeric form (like "1029255142").
Integral type with defined initial value when default constructed.
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
friend Impl * rwcowClone(const Impl *rhs)
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