54 MIL << (*its) << endl;
63 if ( it->first ==
"name" )
65 else if ( it->first ==
"url" && ! it->second.empty() )
67 else if ( it->first ==
"enabled" )
69 else if ( it->first ==
"autorefresh" )
71 else if ( it->first ==
"type" )
73 else if ( it->first ==
"repostoenable" )
75 std::vector<std::string> aliases;
77 for_( ait, aliases.begin(), aliases.end() )
82 else if ( it->first ==
"repostodisable" )
84 std::vector<std::string> aliases;
86 for_( ait, aliases.begin(), aliases.end() )
92 ERR <<
"Unknown attribute " << it->first <<
" ignored" << endl;
95 MIL <<
"Linking ServiceInfo with file " << file << endl;
99 if ( !callback(service) )
MapKVIteratorTraits< SectionSet >::Key_const_iterator section_const_iterator
Read service data from a .service file.
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.
void setAutorefresh(bool autorefresh)
enable or disable autorefresh
ServiceFileReader(const Pathname &serviceFile, const ProcessService &callback)
Constructor.
friend std::ostream & operator<<(std::ostream &str, const ServiceFileReader &obj)
~ServiceFileReader()
Dtor.
void setEnabled(bool enabled)
enable or disable the repository
void addRepoToEnable(const std::string &alias_r)
Add alias_r to the set of ReposToEnable.
void setFilepath(const Pathname &filename)
set the path to the .repo file
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
void setType(const repo::ServiceType &type)
Set service type.
static void parseServices(const Pathname &file, const ServiceFileReader::ProcessService &callback)
unsigned splitEscaped(const C_Str &line_r, _OutputIterator result_r, const C_Str &sepchars_r=" \t", bool withEmpty=false)
Split line_r into words with respect to escape delimeters.
Service type enumeration.
section_const_iterator sectionsBegin() const
entry_const_iterator entriesEnd(const std::string §ion) const
function< bool(const ServiceInfo &)> ProcessService
Callback definition.
void setUrl(const Url &url)
Sets url for this service.
Parses a INI file and offers its structure as a dictionary.
bool strToTrue(const C_Str &str)
Parsing boolean from string.
entry_const_iterator entriesBegin(const std::string §ion) const
Base class for Exception.
void addRepoToDisable(const std::string &alias_r)
Add alias_r to the set of ReposToDisable.
EntrySet::const_iterator entry_const_iterator
void setName(const std::string &name)
set the repository name
section_const_iterator sectionsEnd() const