libzypp: zypp/target/modalias/Modalias.h Source File

libzypp 17.25.10

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
23 namespace zypp
24 {
26 namespace target
27 {
28
30 //
31 // CLASS NAME : Modalias
32 //
35 class Modalias
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
88 RW_pointer<Impl> _pimpl;
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
IdString.h
PtrTypes.h
zypp::IdString
Access to the sat-pools string space.
Definition: IdString.h:43
zypp::IdString::c_str
const char * c_str() const
Conversion to const char *
Definition: IdString.cc:50
zypp::target::Modalias
Hardware abstaction layer singleton.
Definition: Modalias.h:36
zypp::target::Modalias::Modalias
Modalias()
Singleton ctor.
Definition: Modalias.cc:212
zypp::target::Modalias::query
bool query(IdString cap_r) const
Checks if a device on the system matches a modalias pattern.
Definition: Modalias.h:69
zypp::target::Modalias::instance
static Modalias & instance()
Singleton access.
Definition: Modalias.cc:219
zypp::target::Modalias::~Modalias
~Modalias()
Dtor.
Definition: Modalias.cc:216
zypp::target::Modalias::ModaliasList
std::vector< std::string > ModaliasList
Definition: Modalias.h:41
zypp::target::Modalias::modaliasList
const ModaliasList & modaliasList() const
List of modaliases found on system.
Definition: Modalias.cc:228
zypp::target::Modalias::_pimpl
RW_pointer< Impl > _pimpl
Pointer to implementation.
Definition: Modalias.h:88
zypp::target::Modalias::query
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
zypp::target::Modalias::operator<<
friend std::ostream & operator<<(std::ostream &str, const Modalias &obj)
Definition: Modalias.cc:234
str
String related utilities and Regular expression matching.
zypp::target::operator<<
std::ostream & operator<<(std::ostream &str, const CommitPackageCache &obj)
Definition: CommitPackageCache.cc:156
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2
zypp::RW_pointer
Wrapper for const correct access via Smart pointer types.
Definition: PtrTypes.h:286
zypp::target::Modalias::Impl
Modalias implementation.
Definition: Modalias.cc:119