libzypp 17.38.15

ResolverNamespace.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
11#ifndef ZYPP_RESOLVERNAMESPACE_H
12#define ZYPP_RESOLVERNAMESPACE_H
13
14#include <iosfwd>
15#include <cstdint>
16
17#include <zypp-core/Globals.h>
18#include <zypp-core/base/Flags.h>
19#include <zypp/IdString.h>
20
22 namespace zypp
23{
25 enum class ResolverNamespace : std::uint8_t
26 {
27 language = 1<<0,
28 modalias = 1<<1,
29 filesystem = 1<<2,
30 };
31
33 ZYPP_DECLARE_FLAGS_AND_OPERATORS(ResolverNamespaces,ResolverNamespace);
34
36 ZYPP_DEFINE_GLOBAL_CONSTEXPR( ResolverNamespaces, NoResolverNamespaces, ResolverNamespace() )
38 ZYPP_DEFINE_GLOBAL_CONSTEXPR( ResolverNamespaces, AllResolverNamespaces, ResolverNamespace(0xff) )
39
41 inline constexpr IdString asIdString( ResolverNamespace obj )
42 {
43 return IdString( obj == ResolverNamespace::language ? sat::detail::namespaceLanguage
44 : obj == ResolverNamespace::modalias ? sat::detail::namespaceModalias
45 : obj == ResolverNamespace::filesystem ? sat::detail::namespaceFilesystem
46 : sat::detail::noId );
47 }
48
50 inline std::string asString( ResolverNamespace obj )
51 { return asIdString( obj ).asString(); }
52
54 inline std::ostream & operator<<( std::ostream & str, ResolverNamespace obj )
55 { return str << asIdString( obj ); }
56
58 inline std::ostream & operator<<( std::ostream & str, ResolverNamespaces obj )
59 {
60 return str << stringify( obj, {
61 { ResolverNamespace::language, "language" },
62 { ResolverNamespace::modalias, "modalias" },
63 { ResolverNamespace::filesystem, "filesystem" },
64 }, "namespace:", "|", "" );
65 }
66
67} // namespace zypp
69#endif // ZYPP_RESOLVERNAMESPACE_H
Flags.h
Globals.h
Provides API related macros.
ZYPP_DEFINE_GLOBAL_CONSTEXPR
#define ZYPP_DEFINE_GLOBAL_CONSTEXPR(type, name,...)
Definition Globals.h:153
IdString.h
zypp::IdString
Access to the sat-pools string space.
Definition IdString.h:55
zypp::IdString::asString
std::string asString() const
Conversion to std::string.
Definition IdString.h:110
zypp::IdString::IdString
constexpr IdString()
Default ctor, empty string.
Definition IdString.h:61
str
String related utilities and Regular expression matching.
zypp::filesystem
Types and functions for filesystem operations.
Definition Glob.cc:24
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition CodePitfalls.doc:2
zypp::ResolverNamespace
ResolverNamespace
The resolver's dependency namespaces.
Definition ResolverNamespace.h:26
zypp::ResolverNamespace::modalias
@ modalias
hardware support
Definition ResolverNamespace.h:28
zypp::ResolverNamespace::language
@ language
language support
Definition ResolverNamespace.h:27
zypp::ResolverNamespace::filesystem
@ filesystem
filesystems
Definition ResolverNamespace.h:29
zypp::asIdString
constexpr IdString asIdString(ResolverNamespace obj)
relates: ResolverNamespace All bits set.
Definition ResolverNamespace.h:41
zypp::asString
std::string asString(const Patch::Category &obj)
relates: Patch::Category string representation.
Definition Patch.cc:122
zypp::operator<<
std::ostream & operator<<(std::ostream &str, const Capabilities &obj)
relates: Capabilities Stream output
Definition Capabilities.cc:65
zypp::ZYPP_DECLARE_FLAGS_AND_OPERATORS
ZYPP_DECLARE_FLAGS_AND_OPERATORS(ResolverNamespaces, ResolverNamespace)
relates: ResolverNamespace Flags