libzypp 17.31.6
Modalias.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#ifndef ZYPP_TARGET_MODALIAS_MODALIAS_H
13#define ZYPP_TARGET_MODALIAS_MODALIAS_H
14
15#include <iosfwd>
16#include <vector>
17#include <string>
18
19#include <zypp/base/PtrTypes.h>
20#include <zypp/IdString.h>
21
23namespace zypp
24{
26 namespace target
27 {
28
30 //
31 // CLASS NAME : Modalias
32 //
36 {
37 friend std::ostream & operator<<( std::ostream & str, const Modalias & obj );
38
39 public:
41 struct Impl;
42
43 public:
44 typedef std::vector<std::string> ModaliasList;
45
47 static Modalias & instance();
48
50 ~Modalias();
51
52 public:
53
69 bool query( IdString cap_r ) const
70 { return query( cap_r.c_str() ); }
72 bool query( const char * cap_r ) const;
74 bool query( const std::string & cap_r ) const
75 { return query( cap_r.c_str() ); }
76
78 const ModaliasList & modaliasList() const;
79
81 void modaliasList( ModaliasList newlist_r );
82
83 private:
85 Modalias();
86
89 };
91
93 std::ostream & operator<<( std::ostream & str, const Modalias & obj );
94
96 } // namespace target
99} // namespace zypp
101#endif // ZYPP_TARGET_MODALIAS_MODALIAS_H
Access to the sat-pools string space.
Definition: IdString.h:43
const char * c_str() const
Conversion to const char *
Definition: IdString.cc:50
Hardware abstaction layer singleton.
Definition: Modalias.h:36
Modalias()
Singleton ctor.
Definition: Modalias.cc:212
bool query(IdString cap_r) const
Checks if a device on the system matches a modalias pattern.
Definition: Modalias.h:69
static Modalias & instance()
Singleton access.
Definition: Modalias.cc:219
std::vector< std::string > ModaliasList
Definition: Modalias.h:41
const ModaliasList & modaliasList() const
List of modaliases found on system.
Definition: Modalias.cc:228
RW_pointer< Impl > _pimpl
Pointer to implementation.
Definition: Modalias.h:88
bool query(const std::string &cap_r) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: Modalias.h:74
friend std::ostream & operator<<(std::ostream &str, const Modalias &obj)
Definition: Modalias.cc:234
String related utilities and Regular expression matching.
std::ostream & operator<<(std::ostream &str, const CommitPackageCache &obj)
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2
Wrapper for const correct access via Smart pointer types.
Definition: PtrTypes.h:286
Modalias implementation.
Definition: Modalias.cc:119