ref: refs/heads/ma-tmp-pqt
commit 579c77f5c5b0dee08295d30ea20da9745fe562ef
Author: Michael Andres
Date: Fri Apr 10 13:19:27 2009 +0200
New Solvable::isKind overload to test whether a Solvable is within a range of kinds.
---
zypp/sat/Solvable.h | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/zypp/sat/Solvable.h b/zypp/sat/Solvable.h
index d0bbd01..68fbf59 100644
--- a/zypp/sat/Solvable.h
+++ b/zypp/sat/Solvable.h
@@ -149,12 +149,19 @@ namespace zypp
IdString ident() const;
ResKind kind() const;
- /** Test whether a Solvable is of a certain \ref ResKind. */
- bool isKind( const ResKind & kind_r ) const;
+ /** Test whether a Solvable is of a certain \ref ResKind.
+ * The test is far cheaper than actually retriveing and
+ * comparing the \ref kind.
+ */
+ bool isKind( const ResKind & kind_r ) const;
/** \overload */
template<class _Res>
bool isKind() const
{ return isKind( resKind<_Res>() ); }
+ /** \overload Extend the test to a range of \ref ResKind. */
+ template<class _Iterator>
+ bool isKind( _Iterator begin, _Iterator end )
+ { for_( it, begin, end ) if ( isKind( *it ) ) return true; return false; }
std::string name() const;
Edition edition() const;
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org