12 #ifndef ZYPP_REPO_ORIGIN_INCLUDED_H 13 #define ZYPP_REPO_ORIGIN_INCLUDED_H 18 #include <boost/iterator/iterator_facade.hpp> 46 using SettingsMap = std::unordered_map<std::string, std::any>;
63 bool hasConfig(
const std::string &key )
const;
67 void setConfig(
const std::string &key, std::any value );
68 const std::any &getConfig(
const std::string &key )
const;
69 std::any &getConfig(
const std::string &key );
70 void eraseConfigValue(
const std::string &key );
72 const SettingsMap &config()
const;
73 SettingsMap &config();
77 setConfig( key, std::make_any<T>( std::forward<T>(value) ) );
82 const std::any &c = getConfig(key);
85 const T* ref = std::any_cast<
const T>(&c);
87 throw std::bad_any_cast();
94 std::any &c = getConfig(key);
97 T* ref = std::any_cast<T>(&c);
99 throw std::bad_any_cast();
108 std::string scheme()
const;
113 bool schemeIsDownloading()
const;
115 bool isValid()
const;
173 template <
class Parent,
class Value>
174 class iter :
public boost::iterator_facade<
177 , boost::forward_traversal_tag
183 explicit iter( Parent *list, uint idx )
189 friend class boost::iterator_core_access;
193 return ((this->_list == other.
_list) && (this->_idx == other.
_idx));
201 if ( (_idx+1) > _list->endpointCount() )
208 if ( !_list || _idx >= _list->endpointCount() )
209 throw std::out_of_range(
"OriginEndpoint index out of range." );
210 return _list->operator [](_idx);
213 Parent *_list =
nullptr;
230 const std::vector<OriginEndpoint> &authorities()
const;
240 const std::vector<OriginEndpoint> &mirrors()
const;
245 bool isValid()
const;
249 void setMirrors( std::vector<OriginEndpoint> mirrors );
255 std::string scheme()
const;
260 bool schemeIsDownloading()
const;
287 uint endpointCount()
const;
292 uint authorityCount()
const;
339 using iterator = std::vector<MirroredOrigin>::iterator;
397 template<
typename InputIterator>
399 std::for_each(first,last,[
this](
OriginEndpoint ep ) { addEndpoint(std::move(ep));} );
424 void addEndpoints(std::vector<OriginEndpoint> endpoints );
433 const_iterator begin()
const;
436 const_iterator end()
const;
452 bool hasFallbackUrls()
const;
bool equal(iter< Parent, Value > const &other) const
bool operator==(const Capability &lhs, const Capability &rhs)
relates: Capability
std::vector< MirroredOrigin >::const_iterator const_iterator
endpoint_const_iterator end() const
String related utilities and Regular expression matching.
RWCOW_pointer< Private > _pimpl
iter(Parent *list, uint idx)
RWCOW_pointer< Private > _pimpl
typename enable_if< B, T >::type enable_if_t
Manages a data source characterized by an authoritative URL and a list of mirror URLs.
const Arch Arch_empty ZYPP_API
relates: Arch This is an empty Arch represented by an empty string.
Value & dereference() const
bool operator!=(const Capability &lhs, const Capability &rhs)
relates: Capability
std::vector< MirroredOrigin >::iterator iterator
RWCOW_pointer< Private > _pimpl
void addEndpoints(InputIterator first, InputIterator last)
A convenience method to add multiple endpoints from a range.
const OriginEndpoint & operator[](uint index) const
endpoint_const_iterator begin() const
bool operator<(const Capability &lhs, const Capability &rhs)
relates: Capability Arbitrary order.
OriginEndpoint & operator[](uint index)
std::ostream & operator<<(std::ostream &str, const Capabilities &obj)
relates: Capabilities Stream output
Easy-to use interface to the ZYPP dependency resolver.
Represents a single, configurable network endpoint, combining a URL with specific access settings...
endpoint_iterator begin()
A smart container that manages a collection of MirroredOrigin objects, automatically grouping endpoin...
RW_pointer supporting 'copy on write' functionality.