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) )
140 str <<
"--------------------------------------" << std::endl;
141 str <<
"- alias : " <<
alias() << std::endl;
143 str <<
"- name : " <<
rawName() << std::endl;
144 str <<
"- enabled : " <<
enabled() << std::endl;
145 str <<
"- autorefresh : " <<
autorefresh() << std::endl;
153 str <<
"[" <<
alias() <<
"]" << endl;
155 str <<
"name=" <<
rawName() << endl;
156 str <<
"enabled=" << (
enabled() ?
"1" :
"0") << endl;
157 str <<
"autorefresh=" << (
autorefresh() ?
"1" :
"0") << endl;
164 return str <<
"<!-- there's no XML representation of RepoInfoBase -->" << endl;
std::string name() const
Repository name.
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.
Helper filtering the files offered by a RepomdFileReader.
void setEnabled(bool enabled)
enable or disable the repository
RepoVariablesReplacedString _name
std::string _escaped_alias
void setAlias(const std::string &alias)
set the repository alias
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...
std::string rawName() const
The raw metadata name (no default, no variables replaced).
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.
base::ValueTransform< std::string, repo::RepoVariablesStringReplacer > RepoVariablesReplacedString
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.
virtual std::ostream & dumpAsXmlOn(std::ostream &str, const std::string &content="") const
Write an XML representation of this object with content (if available).