00001 /*---------------------------------------------------------------------\ 00002 | ____ _ __ __ ___ | 00003 | |__ / \ / / . \ . \ | 00004 | / / \ V /| _/ _/ | 00005 | / /__ | | | | | | | 00006 | /_____||_| |_| |_| | 00007 | | 00008 \---------------------------------------------------------------------*/ 00009 00010 #ifndef ZYPP_SERVICE_TYPE_H_ 00011 #define ZYPP_SERVICE_TYPE_H_ 00012 00013 #include <iosfwd> 00014 #include <string> 00015 00016 namespace zypp 00017 { 00018 namespace repo 00019 { 00020 00026 struct ServiceType 00027 { 00032 static const ServiceType RIS; 00034 static const ServiceType NONE; 00035 00036 enum Type 00037 { 00038 NONE_e, 00039 RIS_e, 00040 }; 00041 00042 ServiceType() : _type(NONE_e) {} 00043 00044 ServiceType(Type type) : _type(type) {} 00045 00046 explicit ServiceType(const std::string & strval_r); 00047 00048 Type toEnum() const { return _type; } 00049 00050 ServiceType::Type parse(const std::string & strval_r); 00051 00052 const std::string & asString() const; 00053 00054 Type _type; 00055 }; 00056 00057 00058 inline std::ostream & operator<<( std::ostream & str, const ServiceType & obj ) 00059 { return str << obj.asString(); } 00060 00061 inline bool operator==(const ServiceType & obj1, const ServiceType & obj2) 00062 { return obj1._type == obj2._type; } 00063 00064 inline bool operator!=(const ServiceType & obj1, const ServiceType & obj2) 00065 { return ! (obj1 == obj2); } 00066 00067 00068 } // ns repo 00069 } // ns zypp 00070 00071 #endif /* ZYPP_SERVICE_TYPE_H_ */ 00072 00073 // vim: set ts=2 sts=2 sw=2 et ai: