libzypp  13.10.6
ServiceType.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
9 
10 #ifndef ZYPP_SERVICE_TYPE_H_
11 #define ZYPP_SERVICE_TYPE_H_
12 
13 #include <iosfwd>
14 #include <string>
15 
16 namespace zypp
17 {
18  namespace repo
19  {
20 
26  struct ServiceType
27  {
32  static const ServiceType RIS;
34  static const ServiceType NONE;
43  static const ServiceType PLUGIN;
44 
45  enum Type
46  {
50  };
51 
53 
54  ServiceType(Type type) : _type(type) {}
55 
56  explicit ServiceType(const std::string & strval_r);
57 
58  Type toEnum() const { return _type; }
59 
60  ServiceType::Type parse(const std::string & strval_r);
61 
62  const std::string & asString() const;
63 
65  };
66 
67 
68  inline std::ostream & operator<<( std::ostream & str, const ServiceType & obj )
69  { return str << obj.asString(); }
70 
71  inline bool operator==(const ServiceType & obj1, const ServiceType & obj2)
72  { return obj1._type == obj2._type; }
73 
74  inline bool operator!=(const ServiceType & obj1, const ServiceType & obj2)
75  { return ! (obj1 == obj2); }
76 
77 
78  } // ns repo
79 } // ns zypp
80 
81 #endif /* ZYPP_SERVICE_TYPE_H_ */
82 
83 // vim: set ts=2 sts=2 sw=2 et ai:
ServiceType::Type parse(const std::string &strval_r)
Definition: ServiceType.cc:31
const std::string & asString() const
Definition: ServiceType.cc:56
static const ServiceType RIS
Repository Index Service (RIS) (formerly known as &#39;Novell Update&#39; (NU) service)
Definition: ServiceType.h:32
static const ServiceType NONE
No service set.
Definition: ServiceType.h:34
Service type enumeration.
Definition: ServiceType.h:26
std::ostream & operator<<(std::ostream &str, const DeltaCandidates &obj)
bool operator==(const RepoType &obj1, const RepoType &obj2)
Definition: RepoType.h:61
static const ServiceType PLUGIN
Plugin services are scripts installed on your system that provide the package manager with repositori...
Definition: ServiceType.h:43
bool operator!=(const RepoType &obj1, const RepoType &obj2)
Definition: RepoType.h:64
Type toEnum() const
Definition: ServiceType.h:58