16 #include <zypp-core/base/DefaultIntegral> 72 friend Impl * rwcowClone<Impl>(
const Impl * rhs );
76 {
return new Impl( *
this ); }
92 : repo::RepoInfoBase(alias), _pimpl( new
Impl() )
96 : repo::RepoInfoBase(alias), _pimpl( new
Impl(url) )
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;
std::string asString(const Patch::Category &obj)
std::ostream & dumpAsIniOn(std::ostream &str) const override
Writes ServiceInfo to stream in ".service" format.
void setProbedTtl(Date::Duration ttl_r) const
Lazy init sugested TTL.
static unsigned defaultPriority()
The default priority (99).
void clearReposToEnable()
Clear the set of ReposToEnable.
ServiceInfo::ReposToDisable ReposToDisable
void setTtl(Date::Duration ttl_r)
Set sugested TTL.
Date lrf() const
Date of last refresh (if known).
ReposToDisable::size_type reposToDisableSize() const
Url rawUrl() const
The service raw url (no variables replaced)
void setProbedType(const repo::ServiceType &type_r) const
String related utilities and Regular expression matching.
void addRepoToEnable(const std::string &alias_r)
Add alias_r to the set of ReposToEnable.
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
std::ostream & dumpAsXmlOn(std::ostream &str, const std::string &content="") const override
Write an XML representation of this ServiceInfo object.
bool enabled() const
If enabled is false, then this repository must be ignored as if does not exists, except when checking...
void setProbedType(const repo::ServiceType &t) const
Lazy init service type.
std::string asSeconds() const
Convert to string representation of calendar time in numeric form (like "1029255142").
void setType(const repo::ServiceType &type)
Set service type.
RWCOW_pointer< Impl > _pimpl
std::string joinEscaped(TIterator begin, TIterator end, const char sep_r=' ')
Join strings using separator sep_r, quoting or escaping the values.
bool repoToEnableFind(const std::string &alias_r) const
Whether alias_r is mentioned in ReposToEnable.
Impl & operator=(const Impl &)=delete
Store and operate on date (time_t).
std::string escape(const C_Str &str_r, const char sep_r)
Escape desired character c using a backslash.
std::set< std::string > ReposToEnable
Container of repos.
void clearReposToDisable()
Clear the set of ReposToDisable.
const std::string & asString() const
bool reposToEnableEmpty() const
std::string alias() const
unique identifier for this source.
static const ServiceType NONE
No service set.
Service type enumeration.
void setRepoStates(RepoStates newStates_r)
Remember a new set of repository states.
ReposToEnable::size_type reposToEnableSize() const
bool reposToDisableEmpty() const
ReposToDisable::const_iterator reposToDisableEnd() const
ReposToEnable _reposToEnable
base::ValueTransform< Url, repo::RepoVariablesUrlReplacer > RepoVariablesReplacedUrl
ServiceInfo()
Default ctor creates noService.
std::string asString(const Url &url_r)
std::set< std::string > ReposToDisable
Container of repos.
void delRepoToEnable(const std::string &alias_r)
Remove alias_r from the set of ReposToEnable.
std::string numstring(char n, int w=0)
ReposToEnable::const_iterator reposToEnableEnd() const
Date::Duration ttl() const
Sugested TTL between two metadata auto-refreshs.
Url url() const
The service url.
void setUrl(const Url &url)
Set the service url (raw value)
void setLrf(Date lrf_r)
Set date of last refresh.
ReposToDisable::const_iterator reposToDisableBegin() const
ReposToDisable _reposToDisable
const RepoStates & repoStates() const
Access the remembered repository states.
bool repoToDisableFind(const std::string &alias_r) const
Whether alias_r is mentioned in ReposToDisable.
std::string name() const
Repository name.
Impl * clone() const
clone for RWCOW_pointer
static const ServiceInfo noService
Represents an empty service.
std::map< std::string, RepoState > RepoStates
DefaultIntegral< Date::Duration, 0 > _ttl
void delRepoToDisable(const std::string &alias_r)
Remove alias_r from the set of ReposToDisable.
ReposToEnable::const_iterator reposToEnableBegin() const
void addRepoToDisable(const std::string &alias_r)
Add alias_r to the set of ReposToDisable.
bool autorefresh() const
If true, the repostory must be refreshed before creating resolvables from it.
Easy-to use interface to the ZYPP dependency resolver.
RepoVariablesReplacedUrl _url
repo::ServiceType type() const
Service type.
ServiceInfo::ReposToEnable ReposToEnable
detail::EscapedString escape(const std::string &in_r)
Escape xml special charaters (& -> &; from IoBind library).