]> git.saurik.com Git - apt.git/blame - methods/mirror.h
* cmdline/apt-get.cc:
[apt.git] / methods / mirror.h
CommitLineData
5f6b130d
MV
1// -*- mode: cpp; mode: fold -*-
2// Description /*{{{*/// $Id: http.h,v 1.12 2002/04/18 05:09:38 jgg Exp $
3// $Id: http.h,v 1.12 2002/04/18 05:09:38 jgg Exp $
4/* ######################################################################
5
6 MIRROR Aquire Method - This is the MIRROR aquire method for APT.
7
8 ##################################################################### */
9 /*}}}*/
10
11#ifndef APT_MIRROR_H
12#define APT_MIRROR_H
13
14
15#include <iostream>
16
17using std::cout;
18using std::cerr;
19using std::endl;
20
21#include "http.h"
22
14e097c1 23class MirrorMethod : public HttpMethod
5f6b130d
MV
24{
25 FetchResult Res;
86c17f0a 26 // we simply transform between BaseUri and Mirror
14e097c1
MV
27 string BaseUri; // the original mirror://... url
28 string Mirror; // the selected mirror uri (http://...)
38eedeb7
MV
29 string MirrorFile; // the file that contains the list of mirrors
30 bool DownloadedMirrorFile; // already downloaded this session
5f6b130d 31
14e097c1
MV
32 bool Debug;
33
5f6b130d 34 protected:
38eedeb7
MV
35 bool DownloadMirrorFile(string uri);
36 string GetMirrorFileName(string uri);
5f6b130d 37 bool SelectMirror();
d731f9c5 38 bool Clean(string dir);
86c17f0a
MV
39
40 // we need to overwrite those to transform the url back
14e097c1
MV
41 virtual void Fail(string Why, bool Transient = false);
42 virtual void URIStart(FetchResult &Res);
43 virtual void URIDone(FetchResult &Res,FetchResult *Alt = 0);
44 virtual bool Configuration(string Message);
45
5f6b130d
MV
46 public:
47 MirrorMethod();
48 virtual bool Fetch(FetchItem *Itm);
49};
50
51
52#endif