37 : _enabled( indeterminate )
38 , _autorefresh( indeterminate )
41 Impl(
const std::string & alias_r )
42 : _enabled( indeterminate )
43 , _autorefresh( indeterminate )
44 { setAlias( alias_r ); }
58 _alias = _escaped_alias = alias_r;
64 friend Impl * rwcowClone<Impl>(
const Impl * rhs );
67 {
return new Impl( *
this ); }
77 RepoInfoBase::RepoInfoBase()
78 : _pimpl( new
Impl() )
82 : _pimpl( new
Impl(alias) )
137 str <<
"--------------------------------------" << std::endl;
138 str <<
"- alias : " <<
alias() << std::endl;
139 str <<
"- name : " <<
name() << std::endl;
140 str <<
"- enabled : " <<
enabled() << std::endl;
141 str <<
"- autorefresh : " <<
autorefresh() << std::endl;
149 str <<
"[" <<
alias() <<
"]" << endl;
150 str <<
"name=" <<
name() << endl;
151 str <<
"enabled=" << (
enabled() ?
"1" :
"0") << endl;
152 str <<
"autorefresh=" << (
autorefresh() ?
"1" :
"0") << endl;
159 return str <<
"<!-- there's no XML representation of RepoInfoBase -->" << endl;
std::string name() const
Repository short label.
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.
void setAutorefresh(bool autorefresh)
enable or disable autorefresh
static ZConfig & instance()
Singleton ctor.
Pathname filepath() const
File where this repo was read from.
void setEnabled(bool enabled)
enable or disable the repository
std::string _escaped_alias
void setAlias(const std::string &alias)
set the repository alias
String related utilities and Regular expression matching.
void setFilepath(const Pathname &filename)
set the path to the .repo file
virtual std::ostream & dumpAsIniOn(std::ostream &str) const
Write this RepoInfoBase object into str in a .repo (ini) file format.
virtual std::ostream & dumpOn(std::ostream &str) const
Write a human-readable representation of this RepoInfoBase object into the str stream.
bool enabled() const
If enabled is false, then this repository must be ignored as if does not exists, except when checking...
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
std::string & replaceAll(std::string &str_r, const std::string &from_r, const std::string &to_r)
Replace all occurrences of from_r with to_r in str_r (inplace).
std::string label() const
Label for use in messages for the user interface.
std::ostream & operator<<(std::ostream &str, const DeltaCandidates &obj)
Impl(const std::string &alias_r)
bool autorefresh() const
If true, the repostory must be refreshed before creating resolvables from it.
Functor replacing repository variables.
Impl * clone() const
clone for RWCOW_pointer
Base class implementing common features of RepoInfo and ServiceInfo.
void setName(const std::string &name)
set the repository name
void setAlias(const std::string &alias_r)
RWCOW_pointer< Impl > _pimpl
Pointer to implementation.
Easy-to use interface to the ZYPP dependency resolver.
virtual std::ostream & dumpAsXmlOn(std::ostream &str, const std::string &content="") const
Write an XML representation of this object with content (if available).