libzypp 17.37.17
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/Url.h>
15#include <zypp/Pathname.h>
16
17namespace zypp
18{
19 namespace repo
20 {
22 {
23 public:
24
25 RepoMirrorList( const Url & url_r, const Pathname & metadatapath_r );
26
27 RepoMirrorList( const Url & url_r )
28 : RepoMirrorList( url_r, Pathname() )
29 {}
30
31 const std::vector<Url> & getUrls() const
32 { return _urls; }
33
34 std::vector<Url> & getUrls()
35 { return _urls; }
36
37 static bool urlSupportsMirrorLink( const zypp::Url &url );
38
39 constexpr static const char *cookieFileName()
40 {
41 return "mirrorlist.cookie";
42 }
43
44 constexpr static const char* cacheFileName()
45 {
46 return "mirrorlist";
47 }
48
49 private:
50 static void saveToCookieFile(const Pathname &path_r, const zypp::Url &url_r );
51 static std::string readCookieFile( const Pathname &path_r );
52 static std::string makeCookie( const zypp::Url &url_r );
53
54 private:
55 std::vector<Url> _urls;
56 };
57 } // ns repo
58} // ns zypp
59
60#endif
61
62// 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)
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.