47 : type(repo::ServiceType::NONE_e)
52 , type(repo::ServiceType::NONE_e)
60 if ( type == repo::ServiceType::NONE
61 && t != repo::ServiceType::NONE )
64 const_cast<Impl*
>(
this)->type = t;
69 friend Impl * rwcowClone<Impl>(
const Impl * rhs );
73 {
return new Impl( *
this ); }
86 ServiceInfo::ServiceInfo() : _pimpl( new
Impl() ) {}
89 : repo::RepoInfoBase(alias), _pimpl( new
Impl() )
93 : repo::RepoInfoBase(alias), _pimpl( new
Impl(url) )
180 <<
"enabled=" << obj.
enabled <<
" "
187 RepoInfoBase::dumpAsIniOn(str)
188 <<
"url = " <<
rawUrl() << endl
189 <<
"type = " <<
type() << endl;
196 std::string tag(
"repo_" );
200 str << tag <<
"=" << el.first << endl
201 << tag <<
"_enabled=" << state.
enabled << endl
202 << tag <<
"_autorefresh=" << state.
autorefresh << endl;
205 << tag <<
"_priority=" << state.
priority << endl;
222 <<
" enabled=\"" <<
enabled() <<
"\""
230 str <<
">" << endl << content <<
"</service>" << endl;
std::string name() const
Repository name.
ReposToDisable reposToDisable
static unsigned defaultPriority()
The default priority (99).
std::string alias() const
unique identifier for this source.
std::set< std::string > ReposToEnable
Container of repos.
ReposToDisable::size_type reposToDisableSize() const
ReposToEnable::const_iterator reposToEnableBegin() const
void clearReposToEnable()
Clear the set of ReposToEnable.
std::string escape(const C_Str &str_r, const char sep_r)
Escape desired character c using a backslash.
ServiceInfo::ReposToDisable ReposToDisable
void addRepoToEnable(const std::string &alias_r)
Add alias_r to the set of ReposToEnable.
ReposToEnable reposToEnable
const std::string & asString() const
const RepoStates & repoStates() const
Access the remembered repository states.
bool enabled() const
If enabled is false, then this repository must be ignored as if does not exists, except when checking...
ReposToDisable::const_iterator reposToDisableEnd() const
void setType(const repo::ServiceType &type)
Set service type.
base::ValueTransform< Url, repo::RepoVariablesUrlReplacer > RepoVariablesReplacedUrl
RepoVariablesReplacedUrl url
Impl * clone() const
clone for RWCOW_pointer
std::string joinEscaped(_Iterator begin, _Iterator end, const char sep_r= ' ')
Join strings using separator sep_r, quoting or escaping the values.
RWCOW_pointer< Impl > _pimpl
ReposToDisable::const_iterator reposToDisableBegin() const
std::map< std::string, RepoState > RepoStates
void clearReposToDisable()
Clear the set of ReposToDisable.
std::ostream & operator<<(std::ostream &str, const Exception &obj)
Service type enumeration.
void setRepoStates(RepoStates newStates_r)
Remember a new set of repository states.
void setProbedType(const repo::ServiceType &t) const
bool reposToEnableEmpty() const
ServiceInfo()
Default ctor creates noService.
void delRepoToEnable(const std::string &alias_r)
Remove alias_r from the set of ReposToEnable.
std::string numstring(char n, int w=0)
bool reposToDisableEmpty() const
virtual std::ostream & dumpAsXmlOn(std::ostream &str, const std::string &content="") const
Write an XML representation of this ServiceInfo object.
std::string asString(const Patch::SeverityFlag &obj)
void setUrl(const Url &url)
Set the service url (raw value)
ServiceInfo::ReposToEnable ReposToEnable
std::set< std::string > ReposToDisable
Container of repos.
Url rawUrl() const
The service raw url (no variables replaced)
bool autorefresh() const
If true, the repostory must be refreshed before creating resolvables from it.
bool repoToDisableFind(const std::string &alias_r) const
Whether alias_r is mentioned in ReposToDisable.
void delRepoToDisable(const std::string &alias_r)
Remove alias_r from the set of ReposToDisable.
void addRepoToDisable(const std::string &alias_r)
Add alias_r to the set of ReposToDisable.
bool repoToEnableFind(const std::string &alias_r) const
Whether alias_r is mentioned in ReposToEnable.
ReposToEnable::const_iterator reposToEnableEnd() const
ReposToEnable::size_type reposToEnableSize() const
Url url() const
The service url.
void setProbedType(const repo::ServiceType &t) const
Lazy init service type.
virtual std::ostream & dumpAsIniOn(std::ostream &str) const
Writes ServiceInfo to stream in ".service" format.
repo::ServiceType type() const
Service type.
detail::EscapedString escape(const std::string &in_r)
Escape xml special charaters (& -> &; from IoBind library).