libzypp  17.37.5
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 
17 namespace 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:
std::vector< Url > & getUrls()
static std::string readCookieFile(const Pathname &path_r)
static std::string makeCookie(const zypp::Url &url_r)
Generates the cookie value, currently this is only derived from the Url.
std::vector< Url > _urls
static constexpr const char * cacheFileName()
RepoMirrorList(const Url &url_r, const Pathname &metadatapath_r)
static void saveToCookieFile(const Pathname &path_r, const zypp::Url &url_r)
static bool urlSupportsMirrorLink(const zypp::Url &url)
RepoMirrorList(const Url &url_r)
static constexpr const char * cookieFileName()
const std::vector< Url > & getUrls() const
Easy-to use interface to the ZYPP dependency resolver.
Definition: Application.cc:19
Url manipulation class.
Definition: Url.h:92