libzypp  13.10.6
RepoType.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
9 
10 #ifndef ZYPP_REPO_TYPE_H_
11 #define ZYPP_REPO_TYPE_H_
12 
13 #include <iosfwd>
14 #include <string>
15 
16 namespace zypp
17 {
18  namespace repo
19  {
20 
27  struct RepoType
28  {
29  static const RepoType RPMMD;
30  static const RepoType YAST2;
31  static const RepoType RPMPLAINDIR;
32  static const RepoType NONE;
33 
34  enum Type
35  {
40  };
41 
43 
44  RepoType(Type type) : _type(type) {}
45 
46  explicit RepoType(const std::string & strval_r);
47 
48  Type toEnum() const { return _type; }
49 
50  RepoType::Type parse(const std::string & strval_r);
51 
52  const std::string & asString() const;
53 
55  };
56 
57 
58  inline std::ostream & operator<<( std::ostream & str, const RepoType & obj )
59  { return str << obj.asString(); }
60 
61  inline bool operator==(const RepoType & obj1, const RepoType & obj2)
62  { return obj1._type == obj2._type; }
63 
64  inline bool operator!=(const RepoType & obj1, const RepoType & obj2)
65  { return ! (obj1 == obj2); }
66 
67  } // ns repo
68 } // ns zypp
69 
70 #endif
71 
72 // vim: set ts=2 sts=2 sw=2 et ai:
RepoType::Type parse(const std::string &strval_r)
Definition: RepoType.cc:46
std::ostream & operator<<(std::ostream &str, const DeltaCandidates &obj)
bool operator==(const RepoType &obj1, const RepoType &obj2)
Definition: RepoType.h:61
RepoType(Type type)
Definition: RepoType.h:44
const std::string & asString() const
Definition: RepoType.cc:56
static const RepoType NONE
Definition: RepoType.h:32
static const RepoType RPMMD
Definition: RepoType.h:29
bool operator!=(const RepoType &obj1, const RepoType &obj2)
Definition: RepoType.h:64
static const RepoType YAST2
Definition: RepoType.h:30
Type toEnum() const
Definition: RepoType.h:48
static const RepoType RPMPLAINDIR
Definition: RepoType.h:31
Repository type enumeration.
Definition: RepoType.h:27