libzypp: zypp/repo/RepoMirrorList.h Source File

libzypp 17.38.7

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 {
21 class RepoMirrorList
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:
Pathname.h
Url.h
zypp::Url
Url manipulation class.
Definition Url.h:93
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:48
zypp::repo::RepoMirrorList::makeCookie
static std::string makeCookie(const zypp::Url &url_r)
Generates the cookie value, currently this is only derived from the Url.
Definition RepoMirrorList.cc:440
zypp::repo::RepoMirrorList::readCookieFile
static std::string readCookieFile(const Pathname &path_r)
Definition RepoMirrorList.cc:426
zypp::repo::RepoMirrorList::RepoMirrorList
RepoMirrorList(const Url &url_r, const Pathname &metadatapath_r)
Definition RepoMirrorList.cc:330
zypp::repo::RepoMirrorList::RepoMirrorList
RepoMirrorList(const Url &url_r)
Definition RepoMirrorList.h:27
zypp::repo::RepoMirrorList::saveToCookieFile
static void saveToCookieFile(const Pathname &path_r, const zypp::Url &url_r)
Definition RepoMirrorList.cc:445
zypp::repo::RepoMirrorList::getUrls
std::vector< Url > & getUrls()
Definition RepoMirrorList.h:34
zypp::repo::RepoMirrorList::urlSupportsMirrorLink
static bool urlSupportsMirrorLink(const zypp::Url &url)
Definition RepoMirrorList.cc:417
zypp::repo::RepoMirrorList::cookieFileName
static constexpr const char * cookieFileName()
Definition RepoMirrorList.h:39
zypp::repo::RepoMirrorList::getUrls
const std::vector< Url > & getUrls() const
Definition RepoMirrorList.h:31
zypp::repo::RepoMirrorList::cacheFileName
static constexpr const char * cacheFileName()
Definition RepoMirrorList.h:44
zypp::repo::RepoMirrorList::_urls
std::vector< Url > _urls
Definition RepoMirrorList.h:55
zypp::repo
Definition DeltaCandidates.cc:30
zypp::url
Url details namespace.
Definition UrlBase.cc:58
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition CodePitfalls.doc:2