Author: mlandres Date: Mon Sep 22 15:58:10 2008 New Revision: 11125 URL: http://svn.opensuse.org/viewcvs/zypp?rev=11125&view=rev Log: Add Url::hasUserPass() test whether Url has a "username:password" encoded. Modified: trunk/libzypp/zypp/Url.h Modified: trunk/libzypp/zypp/Url.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Url.h?rev=11125&... ============================================================================== --- trunk/libzypp/zypp/Url.h (original) +++ trunk/libzypp/zypp/Url.h Mon Sep 22 15:58:10 2008 @@ -166,7 +166,7 @@ * * Parses \p encodedUrl string using the parseUrl() method * and assigns the result to the current object. - * + * * \param encodedUrl A percent-encoded URL string. * \return A reference to this Url object. * \throws url::UrlParsingException if parsing of the url fails. @@ -281,7 +281,7 @@ * \endcode * * \param opts A combination of view options. - * \return A string representation of the Url object. + * \return A string representation of the Url object. */ std::string asString(const ViewOptions &opts) const; @@ -342,6 +342,12 @@ getPassword(EEncoding eflag = zypp::url::E_DECODED) const; /** + * Returns \c true if username or password are encoded in the authority component. + */ + bool hasUserPass() const + { return ! ( getUsername().empty() && getPassword().empty() ); } + + /** * Returns the hostname or IP from the URL authority. * * In case the Url contains an IP number, it may be surrounded @@ -776,15 +782,15 @@ * needed for std::set */ bool operator<( const Url &lhs, const Url &rhs ); - + /** * needed for find */ bool operator==( const Url &lhs, const Url &rhs ); - - + + bool operator!=( const Url &lhs, const Url &rhs ); - + //////////////////////////////////////////////////////////////////// } // namespace zypp ////////////////////////////////////////////////////////////////////// -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org