[zypp-commit] r8091 - in /trunk/libzypp/zypp: pool/Res2Sat.cc sat/IdStr.h
Author: mlandres Date: Mon Dec 10 16:09:44 2007 New Revision: 8091 URL: http://svn.opensuse.org/viewcvs/zypp?rev=8091&view=rev Log: backup Modified: trunk/libzypp/zypp/pool/Res2Sat.cc trunk/libzypp/zypp/sat/IdStr.h Modified: trunk/libzypp/zypp/pool/Res2Sat.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/pool/Res2Sat.cc?rev=8091&r1=8090&r2=8091&view=diff ============================================================================== --- trunk/libzypp/zypp/pool/Res2Sat.cc (original) +++ trunk/libzypp/zypp/pool/Res2Sat.cc Mon Dec 10 16:09:44 2007 @@ -109,7 +109,7 @@ if ( ! ( res_r && slv ) ) { INT << res_r << " -> " << slv_r << endl; - ZYPP_THROW( Exception( _("Can't store data in NULL objlect") ) ); + ZYPP_THROW( Exception( _("Can't store data in NULL object") ) ); } if ( isKind<Package>( res_r ) ) Modified: trunk/libzypp/zypp/sat/IdStr.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/IdStr.h?rev=8091&r1=8090&r2=8091&view=diff ============================================================================== --- trunk/libzypp/zypp/sat/IdStr.h (original) +++ trunk/libzypp/zypp/sat/IdStr.h Mon Dec 10 16:09:44 2007 @@ -46,16 +46,18 @@ explicit IdStr( const char * str_r ); /** Ctor from string. */ explicit IdStr( const std::string & str_r ); - /** Evaluate in a boolean context (\c != \c Null). */ + /** Evaluate in a boolean context <tt>( != \c Null )</tt>. */ using base::SafeBool<IdStr>::operator bool_type; public: - /** No or Null string. */ + /** No or Null string ( Id \c 0 ). */ static const IdStr Null; /** Empty string. */ static const IdStr Empty; public: + /** Whether string is empty. */ bool empty() const { return( _id == Empty.id() ); } + /** the strings size. */ unsigned size() const; public: /** Conversion to <tt>const char *</tt> */ @@ -84,11 +86,34 @@ /** \relates IdStr */ inline bool operator==( const IdStr & lhs, const IdStr & rhs ) { return lhs.id() == rhs.id(); } + /** \overload */ + inline bool operator==( const IdStr & lhs, const char * rhs ) + { if ( ! rhs ) return( ! lhs ); return( ::strcmp( lhs.c_str(), rhs ) == 0 ); } + /** \overload */ + inline bool operator==( const IdStr & lhs, const std::string & rhs ) + { return( lhs == rhs.c_str() ); } + /** \overload */ + inline bool operator==( const char * lhs, const IdStr & rhs ) + { return( rhs == lhs ); } + /** \overload */ + inline bool operator==( const std::string & lhs, const IdStr & rhs ) + { return( rhs == lhs ); } /** \relates IdStr */ inline bool operator!=( const IdStr & lhs, const IdStr & rhs ) - { return lhs.id() != rhs.id(); } - + { return ! ( lhs == rhs ); } + /** \overload */ + inline bool operator==( const IdStr & lhs, const char * rhs ) + { return ! ( lhs == rhs ); } + /** \overload */ + inline bool operator==( const IdStr & lhs, const std::string & rhs ) + { return ! ( lhs == rhs ); } + /** \overload */ + inline bool operator==( const char * lhs, const IdStr & rhs ) + { return ! ( lhs == rhs ); } + /** \overload */ + inline bool operator==( const std::string & lhs, const IdStr & rhs ) + { return ! ( lhs == rhs ); } ///////////////////////////////////////////////////////////////// } // namespace sat -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org
participants (1)
-
mlandres@svn.opensuse.org