libzypp: zypp/repo/RepoType.h Source File

libzypp 17.38.14

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-core/Globals.h>
16
17namespace zypp
18{
19 namespace repo
20 {
21
28 struct ZYPP_API RepoType
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 {
37 NONE_e,
38 RPMMD_e,
39 YAST2_e,
40 RPMPLAINDIR_e,
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
55 Type _type;
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:
Globals.h
Provides API related macros.
str
String related utilities and Regular expression matching.
zypp::repo
Definition DeltaCandidates.cc:30
zypp::repo::operator!=
bool operator!=(const RepoInfoBase &lhs, const RepoInfoBase &rhs)
relates: RepoInfoBase
Definition RepoInfoBase.h:177
zypp::repo::operator<<
std::ostream & operator<<(std::ostream &str, const DeltaCandidates::Impl &obj)
relates: DeltaCandidates::Impl Stream output
Definition DeltaCandidates.cc:55
zypp::repo::operator==
bool operator==(const RepoInfoBase &lhs, const RepoInfoBase &rhs)
relates: RepoInfoBase
Definition RepoInfoBase.h:173
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition CodePitfalls.doc:2
zypp::ZYPP_API
const Arch Arch_empty ZYPP_API
relates: Arch This is an empty Arch represented by an empty string.
Definition Arch.h:173
zypp::asString
std::string asString(const Patch::Category &obj)
relates: Patch::Category string representation.
Definition Patch.cc:122
zypp::repo::RepoType
Repository type enumeration.
Definition RepoType.h:29
zypp::repo::RepoType::YAST2
static const RepoType YAST2
Definition RepoType.h:31
zypp::repo::RepoType::asString
const std::string & asString() const
Definition RepoType.cc:56
zypp::repo::RepoType::RepoType
RepoType()
Definition RepoType.h:43
zypp::repo::RepoType::Type
Type
Definition RepoType.h:36
zypp::repo::RepoType::RPMMD_e
@ RPMMD_e
Definition RepoType.h:38
zypp::repo::RepoType::NONE_e
@ NONE_e
Definition RepoType.h:37
zypp::repo::RepoType::YAST2_e
@ YAST2_e
Definition RepoType.h:39
zypp::repo::RepoType::RPMPLAINDIR_e
@ RPMPLAINDIR_e
Definition RepoType.h:40
zypp::repo::RepoType::RepoType
RepoType(Type type)
Definition RepoType.h:45
zypp::repo::RepoType::toEnum
Type toEnum() const
Definition RepoType.h:49
zypp::repo::RepoType::RPMMD
static const RepoType RPMMD
Definition RepoType.h:30
zypp::repo::RepoType::_type
Type _type
Definition RepoType.h:55
zypp::repo::RepoType::NONE
static const RepoType NONE
Definition RepoType.h:33
zypp::repo::RepoType::RPMPLAINDIR
static const RepoType RPMPLAINDIR
Definition RepoType.h:32