00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef YUMRESOURCETYPE_H_
00011 #define YUMRESOURCETYPE_H_
00012
00013 #include <iosfwd>
00014 #include<string>
00015
00016 namespace zypp
00017 {
00018 namespace repo
00019 {
00020 namespace yum
00021 {
00022
00023
00027 struct ResourceType
00028 {
00029 static const ResourceType REPOMD;
00030 static const ResourceType PRIMARY;
00031 static const ResourceType OTHER;
00032 static const ResourceType FILELISTS;
00033 static const ResourceType GROUP;
00034 static const ResourceType PATCHES;
00035 static const ResourceType PATCH;
00036 static const ResourceType PRODUCTS;
00037 static const ResourceType PATTERNS;
00038
00039 enum Type
00040 {
00041 NONE_e,
00042 REPOMD_e,
00043 PRIMARY_e,
00044 OTHER_e,
00045 FILELISTS_e,
00046 GROUP_e,
00047 PATCHES_e,
00048 PATCH_e,
00049 PRODUCTS_e,
00050 PATTERNS_e
00051 };
00052
00053 ResourceType(Type type) : _type(type) {}
00054
00055 explicit ResourceType(const std::string & strval_r);
00056
00057 const Type toEnum() const { return _type; }
00058
00059 ResourceType::Type parse(const std::string & strval_r);
00060
00061 const std::string & asString() const;
00062
00063 Type _type;
00064 };
00065
00066
00067 inline std::ostream & operator<<( std::ostream & str, const ResourceType & obj )
00068 { return str << obj.asString(); }
00069
00070 inline bool operator==(const ResourceType & obj1, const ResourceType & obj2)
00071 { return obj1._type == obj2._type; }
00072
00073
00074 }
00075 }
00076 }
00077
00078 #endif
00079
00080