Author: dmacvicar Date: Wed Jul 4 14:51:15 2007 New Revision: 5878 URL: http://svn.opensuse.org/viewcvs/zypp?rev=5878&view=rev Log: - remove useless url check - add old-api-style wrapper Modified: branches/REFACTORING-10_3/libzypp/zypp/MediaProducts.h Modified: branches/REFACTORING-10_3/libzypp/zypp/MediaProducts.h URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/MediaProducts.h?rev=5878&r1=5877&r2=5878&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/MediaProducts.h (original) +++ branches/REFACTORING-10_3/libzypp/zypp/MediaProducts.h Wed Jul 4 14:51:15 2007 @@ -12,6 +12,7 @@ #ifndef ZYPP_MEDIAPRODUCTS_H_ #define ZYPP_MEDIAPRODUCTS_H_ +#include <iterator> #include <iostream> #include <fstream> #include "zypp/ZConfig.h" @@ -38,6 +39,11 @@ : _dir(dir_r), _name(name_r) { } + + bool operator<( const MediaProductEntry &rhs ) const + { + return ( _name < rhs._name ); + } }; /** @@ -56,9 +62,6 @@ template <class _OutputIterator> void productsInMedia( const Url & url_r, _OutputIterator result ) { - if (! url_r.isValid()) - ZYPP_THROW( Exception("Empty URL passed to SourceFactory") ); - media::MediaManager media_mgr; // open the media media::MediaId id = media_mgr.open(url_r); @@ -76,6 +79,19 @@ } media_mgr.release(id); } + + /** + * \short Available products in a url location + * + * \param url_r url to inspect + * \param set ef MediaProductEntry set where + * items will be inserted. + * \throws MediaException If accessng the media fails + */ + void productsInMedia( const Url & url_r, MediaProductSet &set ) + { + productsInMedia(url_r, std::inserter(set, set.end())); + } } // ns zypp -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org