Author: mlandres Date: Thu Jul 5 16:41:56 2007 New Revision: 5890 URL: http://svn.opensuse.org/viewcvs/zypp?rev=5890&view=rev Log: added baseUrlsSize() and baseUrlsEmpty() Modified: branches/REFACTORING-10_3/libzypp/zypp/RepoInfo.cc branches/REFACTORING-10_3/libzypp/zypp/RepoInfo.h Modified: branches/REFACTORING-10_3/libzypp/zypp/RepoInfo.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/... ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/RepoInfo.cc (original) +++ branches/REFACTORING-10_3/libzypp/zypp/RepoInfo.cc Thu Jul 5 16:41:56 2007 @@ -28,13 +28,13 @@ /** RepoInfo implementation. */ struct RepoInfo::Impl { - + Impl() : enabled (indeterminate), autorefresh(indeterminate), type(repo::RepoType::NONE_e) {} - + ~Impl() { //MIL << std::endl; @@ -89,8 +89,8 @@ //MIL << std::endl; } - - + + RepoInfo & RepoInfo::setEnabled( boost::tribool enabled ) { _pimpl->enabled = enabled; @@ -138,7 +138,7 @@ _pimpl->filepath = filepath; return *this; } - + tribool RepoInfo::enabled() const { return _pimpl->enabled; } @@ -153,7 +153,7 @@ Pathname RepoInfo::filepath() const { return _pimpl->filepath; } - + repo::RepoType RepoInfo::type() const { return _pimpl->type; } @@ -162,13 +162,19 @@ std::set<Url> RepoInfo::baseUrls() const { return _pimpl->baseUrls; } - + RepoInfo::urls_const_iterator RepoInfo::baseUrlsBegin() const { return _pimpl->baseUrls.begin(); } - + RepoInfo::urls_const_iterator RepoInfo::baseUrlsEnd() const { return _pimpl->baseUrls.end(); } - + + RepoInfo::urls_size_type RepoInfo::baseUrlsSize() const + { return _pimpl->baseUrls.size(); } + + bool RepoInfo::baseUrlsEmpty() const + { return _pimpl->baseUrls.empty(); } + std::ostream & RepoInfo::dumpOn( std::ostream & str ) const { str << "--------------------------------------" << std::endl; @@ -180,7 +186,7 @@ { str << "- url : " << *it << std::endl; } - + str << "- type : " << type() << std::endl; str << "- enabled : " << enabled() << std::endl; str << "- autorefresh : " << autorefresh() << std::endl; @@ -211,7 +217,7 @@ { return obj.dumpOn(str); } - + ///////////////////////////////////////////////////////////////// } // namespace zypp /////////////////////////////////////////////////////////////////// Modified: branches/REFACTORING-10_3/libzypp/zypp/RepoInfo.h URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/... ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/RepoInfo.h (original) +++ branches/REFACTORING-10_3/libzypp/zypp/RepoInfo.h Thu Jul 5 16:41:56 2007 @@ -63,12 +63,12 @@ class RepoInfo { friend std::ostream & operator<<( std::ostream & str, const RepoInfo & obj ); - + public: RepoInfo(); ~RepoInfo(); //RepoInfo( const Url & url, const Pathname & path, const std::string & alias = "", boost::tribool autorefresh = boost::indeterminate ); - + /** * unique identifier for this source. If not specified * It should be generated from the base url. @@ -77,13 +77,15 @@ * ( [somerepo] ) */ std::string alias() const; - + /** * A Url under which the metadata are located, or a set of mirrors. * * This can't be empty in order the repository to be valid * unless the download of the mirror list succeeds and it * contains a valid url. + * + * \deprecated IMO superfluous as we provide begin/end iterator. */ std::set<Url> baseUrls() const; @@ -92,37 +94,48 @@ * If empty, the base url will be used. */ Url mirrorListUrl() const; - + typedef std::set<Url>::const_iterator urls_const_iterator; - + typedef std::set<Url>::size_type urls_size_type; + /** * iterator that points at begin of repository urls */ urls_const_iterator baseUrlsBegin() const; - + /** * iterator that points at end of repository urls */ urls_const_iterator baseUrlsEnd() const; - + /** + * number of repository urls + */ + urls_size_type baseUrlsSize() const; + + /** + * whether repository urls are available + */ + bool baseUrlsEmpty() const; + + /** * If enabled is false, then this repository must be ignored as if does * not exists, except when checking for duplicate alias. */ boost::tribool enabled() const; - + /** * If true, the repostory must be refreshed before creating resolvables * from it */ boost::tribool autorefresh() const; - + /** * Type of repository, - * + * */ repo::RepoType type() const; - + /** * \short Repository short label * @@ -139,7 +152,7 @@ * infos created in memory. */ Pathname filepath() const; - + /** * Add a base url. \see baseUrls * \param url The base url for the repository. @@ -147,37 +160,37 @@ * To edit or remove urls, create a new RepoInfo instead. */ RepoInfo & addBaseUrl( const Url &url ); - + /** * Set mirror list url. \see mirrorListUrl * \param url The base url for the list */ RepoInfo & setMirrorListUrl( const Url &url ); - + /** * enable or disable the repository \see enabled * \param enabled */ RepoInfo & setEnabled( boost::tribool enabled ); - + /** * enable or disable autorefresh \see autorefresh * \param enabled */ RepoInfo & setAutorefresh( boost::tribool autorefresh ); - + /** * set the repository alias \see alias * \param alias */ RepoInfo & setAlias( const std::string &alias ); - + /** * set the repository type \see type * \param t */ RepoInfo & setType( const repo::RepoType &t ); - + /** * set the repository name \see name * \param name @@ -189,9 +202,9 @@ * \param path File path */ RepoInfo & setFilepath( const Pathname &filename ); - + std::ostream & dumpOn( std::ostream & str ) const; - + std::ostream & dumpRepoOn( std::ostream & str ) const; class Impl; @@ -205,7 +218,7 @@ std::ostream & operator<<( std::ostream & str, const RepoInfo & obj ); typedef std::list<RepoInfo> RepoInfoList; - + ///////////////////////////////////////////////////////////////// } // namespace zypp /////////////////////////////////////////////////////////////////// -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org