-------------------------------------------------------------------
+Tue Sep 9 13:04:11 CEST 2008 - ma@suse.de
+
+- Add ServiceInfo interface to define a set of catalogs (repository
+ aliases) to be enabled on next refresh.
+- revision 10970
+
+-------------------------------------------------------------------
Tue Sep 9 11:40:42 CEST 2008 - ma@suse.de
- Fix reading of Traget::targetDistribution.
using zypp::xml::escape;
///////////////////////////////////////////////////////////////////////////////
-namespace zypp
+namespace zypp
{//////////////////////////////////////////////////////////////////////////////
//
struct ServiceInfo::Impl : public repo::RepoInfoBase::Impl
{
+ typedef ServiceInfo::CatalogsToEnable CatalogsToEnable;
+
public:
Url url;
+ CatalogsToEnable catalogsToEnable;
public:
Impl() : repo::RepoInfoBase::Impl() {}
///////////////////////////////////////////////////////////////////
const ServiceInfo ServiceInfo::noService;
-
+
ServiceInfo::ServiceInfo() : _pimpl( new Impl() ) {}
ServiceInfo::ServiceInfo(const string & alias)
void ServiceInfo::setUrl( const Url& url ) { _pimpl->url = url; }
+ bool catalogsToEnableEmpty() const
+ { return _pimpl->catalogsToEnable.empty(); }
+
+ CatalogsToEnable::size_type catalogsToEnableSize() const
+ { return _pimpl->catalogsToEnable.size(); }
+
+ CatalogsToEnable::const_iterator catalogsToEnableBegin() const
+ { return _pimpl->catalogsToEnable.begin(); }
+
+ CatalogsToEnable::const_iterator catalogsToEnableEnd() const
+ { return _pimpl->catalogsToEnable.end(); }
+
+ bool catalogToEnableFind( const std::string & alias_r ) const
+ { return( _pimpl->catalogsToEnable.find( alias_r ) != _pimpl->catalogsToEnable.end() ); }
+
+ void addCatalogToEnable( const std::string & alias_r )
+ { return _pimpl->catalogsToEnable.insert( alias_r ); }
+
+ void delCatalogToEnable( const std::string & alias_r )
+ { return _pimpl->catalogsToEnable.erase( alias_r ); }
+
+
std::ostream & ServiceInfo::dumpAsIniOn( std::ostream & str ) const
{
- return RepoInfoBase::dumpAsIniOn(str) << "url = " << url() << endl;
+ return RepoInfoBase::dumpAsIniOn(str)
+ << "url = " << url() << endl;
}
std::ostream & ServiceInfo::dumpAsXMLOn( std::ostream & str) const
<< " url=\"" << escape(url().asString()) << "\""
<< "/>" << endl;
}
-
+
std::ostream & operator<<( std::ostream& str, const ServiceInfo &obj )
{
return obj.dumpAsIniOn(str);
*/
Url url() const;
- public:
-
/**
* Sets url for this service
*
*/
void setUrl( const Url& url );
+
+ /** \name Set of catalogs (repository aliases) to enable on next refresh.
+ *
+ * Per default new repositories are created in disabled state. But repositories
+ * mentioned here will be created in enabled state on the next refresh.
+ * Afterwards they get removed from the list.
+ */
+ //@{
+ /** Container of catalogs. */
+ typedef std:set<std::string> CatalogsToEnable;
+ bool catalogsToEnableEmpty() const;
+ CatalogsToEnable::size_type catalogsToEnableSize() const;
+ CatalogsToEnable::const_iterator catalogsToEnableBegin() const;
+ CatalogsToEnable::const_iterator catalogsToEnableEnd() const;
+
+ /** Wheter \c alias_r is mentioned in CatalogsToEnable. */
+ bool catalogToEnableFind( const std::string & alias_r ) const;
+
+ /** Add \c alias_r to the set of CatalogsToEnable. */
+ void addCatalogToEnable( const std::string & alias_r );
+ /** Remove \c alias_r to the set of CatalogsToEnable. */
+ void delCatalogToEnable( const std::string & alias_r );
+ //@}
+
public:
/**
* Writes ServiceInfo to stream in ".service" format