libzypp  17.38.7
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/base/Flags.h>
18 #include <zypp/IdString.h>
19 
21 namespace zypp
22 {
24  enum class ResolverNamespace : std::uint8_t
25  {
26  language = 1<<0,
27  modalias = 1<<1,
28  filesystem = 1<<2,
29  };
30 
33 
35  static constexpr const ResolverNamespaces NoResolverNamespaces = ResolverNamespace();
36 
38  static constexpr const ResolverNamespaces AllResolverNamespaces = ResolverNamespace(0xff);
39 
41  inline constexpr IdString asIdString( ResolverNamespace obj )
42  {
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
static const IdType namespaceModalias(18)
std::string stringify(const Flags< Enum > &flag_r, const std::initializer_list< std::pair< Flags< Enum >, std::string > > &flaglist_r={}, std::string intro_r="[", std::string sep_r="|", const std::string &extro_r="]")
relates: Flags Stringify Build a string of OR&#39;ed names of each flag value set in flag_r.
Definition: Flags.h:137
std::string asString(const Patch::Category &obj)
relates: Patch::Category string representation.
Definition: Patch.cc:122
ZYPP_DECLARE_FLAGS_AND_OPERATORS(ResolverNamespaces, ResolverNamespace)
relates: ResolverNamespace Flags
String related utilities and Regular expression matching.
Access to the sat-pools string space.
Definition: IdString.h:51
constexpr IdString asIdString(ResolverNamespace obj)
relates: ResolverNamespace The underlying libsolv ID
ResolverNamespace
The resolver&#39;s dependency namespaces.
static constexpr const ResolverNamespaces NoResolverNamespaces
relates: ResolverNamespace All bits set.
static const IdType namespaceFilesystem(21)
static constexpr const ResolverNamespaces AllResolverNamespaces
relates: ResolverNamespace All bits set.
static const IdType namespaceLanguage(20)
static const IdType noId(0)
std::string asString() const
Conversion to std::string
Definition: IdString.h:110
std::ostream & operator<<(std::ostream &str, const Capabilities &obj)
relates: Capabilities Stream output
Definition: Capabilities.cc:65
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1
zypp::IdString IdString
Definition: idstring.h:16