libzypp  17.23.8
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:
zypp::repo::ServiceType
Service type enumeration.
Definition: ServiceType.h:26
zypp::repo::ServiceType::ServiceType
ServiceType(Type type)
Definition: ServiceType.h:54
zypp::repo::ServiceType::Type
Type
Definition: ServiceType.h:45
zypp::repo::ServiceType::asString
const std::string & asString() const
Definition: ServiceType.cc:56
zypp::repo::ServiceType::RIS
static const ServiceType RIS
Repository Index Service (RIS) (formerly known as 'Novell Update' (NU) service)
Definition: ServiceType.h:32
zypp::repo::ServiceType::parse
ServiceType::Type parse(const std::string &strval_r)
Definition: ServiceType.cc:31
zypp::repo::ServiceType::NONE_e
Definition: ServiceType.h:47
zypp::repo::ServiceType::RIS_e
Definition: ServiceType.h:48
zypp::repo::operator==
bool operator==(const RepoType &obj1, const RepoType &obj2)
Definition: RepoType.h:61
zypp::repo::operator<<
std::ostream & operator<<(std::ostream &str, const DeltaCandidates &obj)
Definition: DeltaCandidates.cc:107
zypp::repo::ServiceType::PLUGIN
static const ServiceType PLUGIN
Plugin services are scripts installed on your system that provide the package manager with repositori...
Definition: ServiceType.h:43
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1
zypp::repo::ServiceType::toEnum
Type toEnum() const
Definition: ServiceType.h:58
zypp::repo::ServiceType::_type
Type _type
Definition: ServiceType.h:64
zypp::repo::ServiceType::NONE
static const ServiceType NONE
No service set.
Definition: ServiceType.h:34
zypp::repo::operator!=
bool operator!=(const RepoType &obj1, const RepoType &obj2)
Definition: RepoType.h:64
str
String related utilities and Regular expression matching.
zypp::repo::ServiceType::PLUGIN_e
Definition: ServiceType.h:49
zypp::repo::ServiceType::ServiceType
ServiceType()
Definition: ServiceType.h:52