libzypp  17.35.15
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 #include <zypp/Globals.h>
16 
17 namespace zypp
18 {
19  namespace repo
20  {
21 
29  {
30  static const RepoType RPMMD;
31  static const RepoType YAST2;
32  static const RepoType RPMPLAINDIR;
33  static const RepoType NONE;
34 
35  enum Type
36  {
41  };
42 
43  RepoType() : _type(NONE_e) {}
44 
45  RepoType(Type type) : _type(type) {}
46 
47  explicit RepoType(const std::string & strval_r);
48 
49  Type toEnum() const { return _type; }
50 
51  RepoType::Type parse(const std::string & strval_r);
52 
53  const std::string & asString() const;
54 
56  };
57 
58 
59  inline std::ostream & operator<<( std::ostream & str, const RepoType & obj )
60  { return str << obj.asString(); }
61 
62  inline bool operator==(const RepoType & obj1, const RepoType & obj2)
63  { return obj1._type == obj2._type; }
64 
65  inline bool operator!=(const RepoType & obj1, const RepoType & obj2)
66  { return ! (obj1 == obj2); }
67 
68  } // ns repo
69 } // ns zypp
70 
71 #endif
72 
73 // vim: set ts=2 sts=2 sw=2 et ai:
std::string asString(const Patch::Category &obj)
Definition: Patch.cc:122
Type toEnum() const
Definition: RepoType.h:49
String related utilities and Regular expression matching.
const std::string & asString() const
Definition: RepoType.cc:56
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
Definition: ResTraits.h:93
std::ostream & operator<<(std::ostream &str, const DeltaCandidates &obj)
bool operator==(const RepoType &obj1, const RepoType &obj2)
Definition: RepoType.h:62
RepoType(Type type)
Definition: RepoType.h:45
static const RepoType NONE
Definition: RepoType.h:33
static const RepoType RPMMD
Definition: RepoType.h:30
bool operator!=(const RepoType &obj1, const RepoType &obj2)
Definition: RepoType.h:65
static const RepoType YAST2
Definition: RepoType.h:31
static const RepoType RPMPLAINDIR
Definition: RepoType.h:32
Easy-to use interface to the ZYPP dependency resolver.
Definition: Application.cc:19
Repository type enumeration.
Definition: RepoType.h:28