ref: refs/heads/ma-tmp-pqt
commit c1ba47bd673e4aedb22180605709230094c7389c
Author: Michael Andres
Date: Fri Apr 17 11:03:40 2009 +0200
prepare rx eceptions
---
zypp/sat/AttrMatcher.cc | 1 -
zypp/sat/AttrMatcher.h | 5 ++++-
zypp/sat/LookupAttr.cc | 9 +++++++++
zypp/sat/LookupAttr.h | 3 +++
4 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/zypp/sat/AttrMatcher.cc b/zypp/sat/AttrMatcher.cc
index e85e1d2..8aca558 100644
--- a/zypp/sat/AttrMatcher.cc
+++ b/zypp/sat/AttrMatcher.cc
@@ -88,7 +88,6 @@ namespace zypp
{
if ( _matcher )
::datamatcher_free( _matcher.get() );
- //_search[0] = 0;
_matcher.reset();
}
diff --git a/zypp/sat/AttrMatcher.h b/zypp/sat/AttrMatcher.h
index 17c9ab9..4e324fd 100644
--- a/zypp/sat/AttrMatcher.h
+++ b/zypp/sat/AttrMatcher.h
@@ -50,6 +50,8 @@ namespace zypp
*
* \todo Enhance the search flags manip interface; Enums and
* Flags are missing; int flags should not be needed.
+ *
+ * \todo Add regex Excetion to doMatch.
*/
class AttrMatcher : private base::SafeBool<AttrMatcher>
{
@@ -104,7 +106,8 @@ namespace zypp
void setFlags( int flags_r );
private:
- /** Return whether string matches. */
+ /** Return whether string matches.
+ */
bool doMatch( const char * string_r ) const;
private:
diff --git a/zypp/sat/LookupAttr.cc b/zypp/sat/LookupAttr.cc
index 8b850ac..f66ed96 100644
--- a/zypp/sat/LookupAttr.cc
+++ b/zypp/sat/LookupAttr.cc
@@ -268,6 +268,15 @@ namespace zypp
_mstring.empty() ? 0 : _mstring.c_str(), flags_r );
}
+ DIWrap::DIWrap( RepoIdType repoId_r, SolvableIdType solvId_r, IdType attrId_r,
+ const char * mstring_r, int flags_r )
+ : _dip( new ::Dataiterator )
+ , _mstring( mstring_r ? mstring_r : "" )
+ {
+ ::dataiterator_init( _dip, sat::Pool::instance().get(), repoId_r, solvId_r, attrId_r,
+ _mstring.empty() ? 0 : _mstring.c_str(), flags_r );
+ }
+
DIWrap::DIWrap( const DIWrap & rhs )
: _dip( 0 )
, _mstring( rhs._mstring )
diff --git a/zypp/sat/LookupAttr.h b/zypp/sat/LookupAttr.h
index 9886609..eff1ce2 100644
--- a/zypp/sat/LookupAttr.h
+++ b/zypp/sat/LookupAttr.h
@@ -268,6 +268,9 @@ namespace zypp
/** Initializes */
DIWrap( RepoIdType repoId_r, SolvableIdType solvId_r, IdType attrId_r,
const std::string & mstring_r = std::string(), int flags_r = 0 );
+ /** \overload to catch \c NULL \a mstring_r. */
+ DIWrap( RepoIdType repoId_r, SolvableIdType solvId_r, IdType attrId_r,
+ const char * mstring_r, int flags_r = 0 );
DIWrap( const DIWrap & rhs );
~DIWrap();
public:
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org