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

libzypp 17.38.5

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-core/Globals.h>
20#include <zypp-core/base/PtrTypes.h>
21#include <zypp/IdString.h>
22
24namespace zypp
25{
27 namespace target
28 {
29
31 //
32 // CLASS NAME : Modalias
33 //
36 class ZYPP_API_DEPTESTOMATIC Modalias
37 {
38 friend std::ostream & operator<<( std::ostream & str, const Modalias & obj );
39
40 public:
42 struct Impl;
43
44 public:
45 using ModaliasList = std::vector<std::string>;
46
48 static Modalias & instance();
49
51 ~Modalias();
52
53 public:
54
70 bool query( IdString cap_r ) const
71 { return query( cap_r.c_str() ); }
72
73 bool query( const char * cap_r ) const;
75 bool query( const std::string & cap_r ) const
76 { return query( cap_r.c_str() ); }
77
79 const ModaliasList & modaliasList() const;
80
82 void modaliasList( ModaliasList newlist_r );
83
84 private:
86 Modalias();
87
89 RW_pointer<Impl> _pimpl;
90 };
91
92
94 std::ostream & operator<<( std::ostream & str, const Modalias & obj ) ZYPP_API_DEPTESTOMATIC;
95
97 } // namespace target
100} // namespace zypp
102#endif // ZYPP_TARGET_MODALIAS_MODALIAS_H
Globals.h
Provides API related macros.
ZYPP_API_DEPTESTOMATIC
#define ZYPP_API_DEPTESTOMATIC
Definition Globals.h:77
IdString.h
operator<<
std::ostream & operator<<(std::ostream &str, const zypp::sat::detail::CDataiterator *obj)
Definition LookupAttr.cc:808
PtrTypes.h
zypp::IdString
Access to the sat-pools string space.
Definition IdString.h:44
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:37
zypp::target::Modalias::ModaliasList
std::vector< std::string > ModaliasList
Definition Modalias.h:45
zypp::target::Modalias::Modalias
Modalias()
Singleton ctor.
Definition Modalias.cc:216
zypp::target::Modalias::query
bool query(IdString cap_r) const
Checks if a device on the system matches a modalias pattern.
Definition Modalias.h:70
zypp::target::Modalias::instance
static Modalias & instance()
Singleton access.
Definition Modalias.cc:223
zypp::target::Modalias::_pimpl
RW_pointer< Impl > _pimpl
Pointer to implementation.
Definition Modalias.h:89
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:75
str
String related utilities and Regular expression matching.
zypp::target
Definition KeyRing.h:325
zypp::target::operator<<
std::ostream & operator<<(std::ostream &str, const CommitPackageCache &obj)
Definition CommitPackageCache.cc:155
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:293
zypp::target::Modalias::Impl
Modalias implementation.
Definition Modalias.cc:119