libzypp  17.36.7
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 
27  {
32  static const ServiceType RIS ZYPP_API;
34  static const ServiceType NONE ZYPP_API;
43  static const ServiceType PLUGIN ZYPP_API;
44 
45  enum Type
46  {
50  };
51 
52  ServiceType() : _type(NONE_e) {}
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:
std::string asString(const Patch::Category &obj)
Definition: Patch.cc:122
String related utilities and Regular expression matching.
static const ServiceType NONE ZYPP_API
No service set.
Definition: ServiceType.h:34
static const ServiceType PLUGIN ZYPP_API
Plugin services are scripts installed on your system that provide the package manager with repositori...
Definition: ServiceType.h:43
const std::string & asString() const
Definition: ServiceType.cc:55
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
Definition: ResTraits.h:93
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:62
static const ServiceType RIS ZYPP_API
Repository Index Service (RIS) (formerly known as &#39;Novell Update&#39; (NU) service)
Definition: ServiceType.h:32
bool operator!=(const RepoType &obj1, const RepoType &obj2)
Definition: RepoType.h:65
Easy-to use interface to the ZYPP dependency resolver.
Definition: Application.cc:19