libzypp  13.10.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 
23 namespace zypp
24 {
25  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  class 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
Modalias()
Singleton ctor.
Definition: Modalias.cc:191
bool query(IdString cap_r) const
Checks if a device on the system matches a modalias pattern.
Definition: Modalias.h:69
RW_pointer< Impl > _pimpl
Pointer to implementation.
Definition: Modalias.h:88
Access to the sat-pools string space.
Definition: IdString.h:39
bool query(const std::string &cap_r) const
Definition: Modalias.h:74
const ModaliasList & modaliasList() const
List of modaliases found on system.
Definition: Modalias.cc:207
std::ostream & operator<<(std::ostream &str, const CommitPackageCache &obj)
const char * c_str() const
Conversion to const char *
Definition: IdString.cc:42
std::vector< std::string > ModaliasList
Definition: Modalias.h:41
static Modalias & instance()
Singleton access.
Definition: Modalias.cc:198
friend std::ostream & operator<<(std::ostream &str, const Modalias &obj)
Definition: Modalias.cc:213
Wrapper for const correct access via Smart pointer types.
Definition: PtrTypes.h:265
Modalias implementation.
Definition: Modalias.cc:97
Hardware abstaction layer singleton.
Definition: Modalias.h:35