1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/ServiceInfo.h
12 #ifndef ZYPP_SERVICE_H
13 #define ZYPP_SERVICE_H
19 #include "zypp/repo/RepoInfoBase.h"
22 ///////////////////////////////////////////////////////////////////
24 { /////////////////////////////////////////////////////////////////
26 ///////////////////////////////////////////////////////////////////
28 // CLASS NAME : ServiceInfo
31 class ServiceInfo : public repo::RepoInfoBase
34 /** Default ctor creates \ref noService.*/
38 * Creates ServiceInfo with specified alias.
40 * \param alias unique short name of service
42 ServiceInfo( const std::string & alias );
45 * ServiceInfo with alias and its URL
47 * \param alias unique shortname of service
48 * \param url url to service
50 ServiceInfo( const std::string & alias, const Url& url );
53 /** Represents an empty service. */
54 static const ServiceInfo noService;
61 * \return url to service
66 * Sets url for this service
68 * \param url url to this service
70 void setUrl( const Url& url );
73 /** \name Set of catalogs (repository aliases) to enable on next refresh.
75 * Per default new repositories are created in disabled state. But repositories
76 * mentioned here will be created in enabled state on the next refresh.
77 * Afterwards they get removed from the list.
80 /** Container of catalogs. */
81 typedef std:set<std::string> CatalogsToEnable;
82 bool catalogsToEnableEmpty() const;
83 CatalogsToEnable::size_type catalogsToEnableSize() const;
84 CatalogsToEnable::const_iterator catalogsToEnableBegin() const;
85 CatalogsToEnable::const_iterator catalogsToEnableEnd() const;
87 /** Wheter \c alias_r is mentioned in CatalogsToEnable. */
88 bool catalogToEnableFind( const std::string & alias_r ) const;
90 /** Add \c alias_r to the set of CatalogsToEnable. */
91 void addCatalogToEnable( const std::string & alias_r );
92 /** Remove \c alias_r to the set of CatalogsToEnable. */
93 void delCatalogToEnable( const std::string & alias_r );
98 * Writes ServiceInfo to stream in ".service" format
100 * \param str stream where serialized version service is written
102 virtual std::ostream & dumpAsIniOn( std::ostream & str ) const;
105 * Write an XML representation of this ServiceInfo object.
107 virtual std::ostream & dumpAsXMLOn( std::ostream & str) const;
112 RWCOW_pointer<Impl> _pimpl;
114 ///////////////////////////////////////////////////////////////////
116 typedef shared_ptr<ServiceInfo> ServiceInfo_Ptr;
118 /** \relates ServiceInfo Stream output */
119 std::ostream & operator<<( std::ostream & str, const ServiceInfo & obj );
122 /////////////////////////////////////////////////////////////////
124 ///////////////////////////////////////////////////////////////////
125 #endif // ZYPP_SAT_REPOSITORY_H