libzypp  11.13.5
ResourceType.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
9 
10 #ifndef YUMRESOURCETYPE_H_
11 #define YUMRESOURCETYPE_H_
12 
13 #include <iosfwd>
14 #include<string>
15 
16 namespace zypp
17 {
18  namespace repo
19  {
20  namespace yum
21  {
22 
23 
27  struct ResourceType
28  {
29  static const ResourceType NONE; // unknown
30  static const ResourceType REPOMD;
31  static const ResourceType PRIMARY;
32  static const ResourceType OTHER;
33  static const ResourceType FILELISTS;
34  static const ResourceType GROUP;
35  static const ResourceType PATCHES; // suse extension
36  static const ResourceType PATCH; // suse extension
37  static const ResourceType PRODUCT; // suse extension
38  static const ResourceType PATTERNS; // suse extension
39  // sqlite caches yum extensions:
40  static const ResourceType PRIMARY_DB; // yum extension
41  static const ResourceType OTHER_DB; // yum extension
42 
43  enum Type
44  {
57  };
58 
59  ResourceType(Type type) : _type(type) {}
60 
61  explicit ResourceType(const std::string & strval_r);
62 
63  Type toEnum() const { return _type; }
64 
65  ResourceType::Type parse(const std::string & strval_r);
66 
67  const std::string & asString() const;
68 
70  };
71 
72 
73  inline std::ostream & operator<<( std::ostream & str, const ResourceType & obj )
74  { return str << obj.asString(); }
75 
76  inline bool operator==(const ResourceType & obj1, const ResourceType & obj2)
77  { return obj1._type == obj2._type; }
78 
79 
80  } // ns yum
81  } // ns source
82 } // ns zypp
83 
84 #endif /*YUMRESOURCETYPE_H_*/
85 
86 // vim: set ts=2 sts=2 sw=2 et ai: