libzypp  17.35.11
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/Globals.h>
20 #include <zypp/base/PtrTypes.h>
21 #include <zypp/IdString.h>
22 
24 namespace zypp
25 {
26  namespace target
28  {
29 
31  //
32  // CLASS NAME : Modalias
33  //
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() ); }
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 
90  };
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
RW_pointer< Impl > _pimpl
Pointer to implementation.
Definition: Modalias.h:89
String related utilities and Regular expression matching.
Access to the sat-pools string space.
Definition: IdString.h:43
bool query(const std::string &cap_r) const
Definition: Modalias.h:75
#define ZYPP_API_DEPTESTOMATIC
Definition: Globals.h:77
std::ostream & operator<<(std::ostream &str, const CommitPackageCache &obj)
bool query(IdString cap_r) const
Checks if a device on the system matches a modalias pattern.
Definition: Modalias.h:70
const char * c_str() const
Conversion to const char *
Definition: IdString.cc:50
std::vector< std::string > ModaliasList
Definition: Modalias.h:45
Modalias implementation.
Definition: Modalias.cc:118
Easy-to use interface to the ZYPP dependency resolver.
Definition: Application.cc:19
Hardware abstaction layer singleton.
Definition: Modalias.h:36