libzypp 17.37.10

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 ZYPP_API ServiceType
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 {
47 NONE_e,
48 RIS_e,
49 PLUGIN_e,
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
64 Type _type;
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:
str
String related utilities and Regular expression matching.
zypp::repo
Definition DeltaCandidates.cc:30
zypp::repo::operator<<
std::ostream & operator<<(std::ostream &str, const DeltaCandidates &obj)
Definition DeltaCandidates.cc:108
zypp::repo::operator==
bool operator==(const RepoType &obj1, const RepoType &obj2)
Definition RepoType.h:62
zypp::repo::operator!=
bool operator!=(const RepoType &obj1, const RepoType &obj2)
Definition RepoType.h:65
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition Application.cc:20
zypp::asString
std::string asString(const Patch::Category &obj)
Definition Patch.cc:122
zypp::repo::ServiceType
Service type enumeration.
Definition ServiceType.h:27
zypp::repo::ServiceType::ZYPP_API
static const ServiceType RIS ZYPP_API
Repository Index Service (RIS) (formerly known as 'Novell Update' (NU) service)
Definition ServiceType.h:32
zypp::repo::ServiceType::asString
const std::string & asString() const
Definition ServiceType.cc:55
zypp::repo::ServiceType::_type
Type _type
Definition ServiceType.h:64
zypp::repo::ServiceType::toEnum
Type toEnum() const
Definition ServiceType.h:58
zypp::repo::ServiceType::ServiceType
ServiceType()
Definition ServiceType.h:52
zypp::repo::ServiceType::ServiceType
ServiceType(Type type)
Definition ServiceType.h:54
zypp::repo::ServiceType::Type
Type
Definition ServiceType.h:46
zypp::repo::ServiceType::RIS_e
@ RIS_e
Definition ServiceType.h:48
zypp::repo::ServiceType::NONE_e
@ NONE_e
Definition ServiceType.h:47
zypp::repo::ServiceType::PLUGIN_e
@ PLUGIN_e
Definition ServiceType.h:49