libzypp 17.38.15
RepoMirrorList.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
9
10#ifndef ZYPP_REPO_MIRRORLIST_H_
11#define ZYPP_REPO_MIRRORLIST_H_
12
13#include <vector>
14#include <zypp-core/Url.h>
15#include <zypp-core/Pathname.h>
16
17namespace zypp
18{
19 namespace repo
20 {
22 {
23 public:
24
26 RepoMirrorList( const Url & url_r, const Pathname & metadatapath_r, bool cacheFailure_r = false );
27
28 RepoMirrorList( const Url & url_r )
29 : RepoMirrorList( url_r, Pathname() )
30 {}
31
32 const std::vector<Url> & getUrls() const
33 { return _urls; }
34
35 std::vector<Url> & getUrls()
36 { return _urls; }
37
38 static bool urlSupportsMirrorLink( const zypp::Url &url );
39
40 constexpr static const char *cookieFileName()
41 {
42 return "mirrorlist.cookie";
43 }
44
45 constexpr static const char* cacheFileName()
46 {
47 return "mirrorlist";
48 }
49
50 private:
51 static void saveToCookieFile(const Pathname &path_r, const zypp::Url &url_r );
52 static std::string readCookieFile( const Pathname &path_r );
53 static std::string makeCookie( const zypp::Url &url_r );
54
55 private:
56 std::vector<Url> _urls;
57 };
58 } // ns repo
59} // ns zypp
60
61#endif
62
63// vim: set ts=2 sts=2 sw=2 et ai:
Url manipulation class.
Definition Url.h:93
static std::string makeCookie(const zypp::Url &url_r)
Generates the cookie value, currently this is only derived from the Url.
static std::string readCookieFile(const Pathname &path_r)
RepoMirrorList(const Url &url_r, const Pathname &metadatapath_r, bool cacheFailure_r=false)
RepoMirrorList(const Url &url_r)
static void saveToCookieFile(const Pathname &path_r, const zypp::Url &url_r)
std::vector< Url > & getUrls()
static bool urlSupportsMirrorLink(const zypp::Url &url)
static constexpr const char * cookieFileName()
const std::vector< Url > & getUrls() const
static constexpr const char * cacheFileName()
std::vector< Url > _urls
Url details namespace.
Definition UrlBase.cc:58
Easy-to use interface to the ZYPP dependency resolver.