1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/capability/ModaliasCap.h
12 #ifndef ZYPP_CAPABILITY_MODALIASCAP_H
13 #define ZYPP_CAPABILITY_MODALIASCAP_H
15 #include "zypp/base/Deprecated.h"
16 #include "zypp/capability/CapabilityImpl.h"
18 ///////////////////////////////////////////////////////////////////
20 { /////////////////////////////////////////////////////////////////
21 ///////////////////////////////////////////////////////////////////
23 { /////////////////////////////////////////////////////////////////
25 DEFINE_PTR_TYPE(ModaliasCap)
27 ///////////////////////////////////////////////////////////////////
29 // CLASS NAME : ModaliasCap
31 /** A Capability resolved by a query to target::modalias.
33 * \note ModaliasCap is special as it is self evaluating, and does not
34 * comapre to the \a rhs (or \a lhs). This is currently solved by
35 * treating a ModaliasCap with an empty name as evaluate command.
37 * \ref matches returns \c CapMatch::irrelevant, if either both sides
38 * are evaluate commands, or both are not.
40 * Otherwise the result of the query to target::modalias is returned.
41 * Either from \a lhs or \a rhs, dependent on which one is the
44 class ModaliasCap : public CapabilityImpl
47 typedef ModaliasCap Self;
48 typedef ModaliasCap_Ptr Ptr;
49 typedef ModaliasCap_constPtr constPtr;
53 ModaliasCap( const Resolvable::Kind & refers_r, const std::string & name_r );
56 ModaliasCap( const Resolvable::Kind & refers_r,
57 const std::string & name_r,
59 const std::string & value_r );
63 virtual const Kind & kind() const;
65 /** Query target::Modalias. */
66 virtual CapMatch matches( const CapabilityImpl::constPtr & rhs ) const;
68 /** <tt>modalias(name) [op value]</tt> */
69 virtual std::string encode() const;
71 /** <tt>modalias()</tt> */
72 virtual std::string index() const;
75 const std::string & pkgname() const
78 void setPkgname( const std::string &pn )
81 ZYPP_DEPRECATED const std::string & querystring() const
84 const std::string & name() const
90 const std::string & value() const
94 /** Empty ModaliasCap <tt>modalias()</tt> */
95 bool isEvalCmd() const;
97 /** Query target::Modalias. */
98 bool evaluate() const;
102 std::string _pkgname;
107 ///////////////////////////////////////////////////////////////////
109 /////////////////////////////////////////////////////////////////
110 } // namespace capability
111 ///////////////////////////////////////////////////////////////////
112 /////////////////////////////////////////////////////////////////
114 ///////////////////////////////////////////////////////////////////
115 #endif // ZYPP_CAPABILITY_MODALIASCAP_H