1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/ServiceInfo.h
12 #ifndef ZYPP_SERVICE_H
13 #define ZYPP_SERVICE_H
20 #include "zypp/repo/RepoInfoBase.h"
23 ///////////////////////////////////////////////////////////////////
25 { /////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////
29 // CLASS NAME : ServiceInfo
32 class ServiceInfo : public repo::RepoInfoBase
35 /** Default ctor creates \ref noService.*/
39 * Creates ServiceInfo with specified alias.
41 * \param alias unique short name of service
43 ServiceInfo( const std::string & alias );
46 * ServiceInfo with alias and its URL
48 * \param alias unique shortname of service
49 * \param url url to service
51 ServiceInfo( const std::string & alias, const Url& url );
54 /** Represents an empty service. */
55 static const ServiceInfo noService;
62 * \return url to service
67 * Sets url for this service
69 * \param url url to this service
71 void setUrl( const Url& url );
74 /** \name Set of catalogs (repository aliases) to enable on next refresh.
76 * Per default new repositories are created in disabled state. But repositories
77 * mentioned here will be created in enabled state on the next refresh.
78 * Afterwards they get removed from the list.
81 /** Container of catalogs. */
82 typedef std::set<std::string> CatalogsToEnable;
83 bool catalogsToEnableEmpty() const;
84 CatalogsToEnable::size_type catalogsToEnableSize() const;
85 CatalogsToEnable::const_iterator catalogsToEnableBegin() const;
86 CatalogsToEnable::const_iterator catalogsToEnableEnd() const;
88 /** Wheter \c alias_r is mentioned in CatalogsToEnable. */
89 bool catalogToEnableFind( const std::string & alias_r ) const;
91 /** Add \c alias_r to the set of CatalogsToEnable. */
92 void addCatalogToEnable( const std::string & alias_r );
93 /** Remove \c alias_r to the set of CatalogsToEnable. */
94 void delCatalogToEnable( const std::string & alias_r );
99 * Writes ServiceInfo to stream in ".service" format
101 * \param str stream where serialized version service is written
103 virtual std::ostream & dumpAsIniOn( std::ostream & str ) const;
106 * Write an XML representation of this ServiceInfo object.
108 virtual std::ostream & dumpAsXMLOn( std::ostream & str) const;
113 RWCOW_pointer<Impl> _pimpl;
115 ///////////////////////////////////////////////////////////////////
117 typedef shared_ptr<ServiceInfo> ServiceInfo_Ptr;
119 /** \relates ServiceInfo Stream output */
120 std::ostream & operator<<( std::ostream & str, const ServiceInfo & obj );
123 /////////////////////////////////////////////////////////////////
125 ///////////////////////////////////////////////////////////////////
126 #endif // ZYPP_SAT_REPOSITORY_H