libzypp 17.31.0
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
16namespace 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:
String related utilities and Regular expression matching.
std::ostream & operator<<(std::ostream &str, const DeltaCandidates &obj)
bool operator==(const RepoType &obj1, const RepoType &obj2)
Definition: RepoType.h:61
bool operator!=(const RepoType &obj1, const RepoType &obj2)
Definition: RepoType.h:64
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2
Repository type enumeration.
Definition: RepoType.h:28
RepoType::Type parse(const std::string &strval_r)
Definition: RepoType.cc:46
static const RepoType YAST2
Definition: RepoType.h:30
const std::string & asString() const
Definition: RepoType.cc:56
RepoType(Type type)
Definition: RepoType.h:44
Type toEnum() const
Definition: RepoType.h:48
static const RepoType RPMMD
Definition: RepoType.h:29
static const RepoType NONE
Definition: RepoType.h:32
static const RepoType RPMPLAINDIR
Definition: RepoType.h:31