]>
git.saurik.com Git - apt.git/blob - methods/aptmethod.h
1 #ifndef APT_APTMETHOD_H
2 #define APT_APTMETHOD_H
4 #include <apt-pkg/acquire-method.h>
5 #include <apt-pkg/configuration.h>
10 class aptMethod
: public pkgAcqMethod
12 char const * const Binary
;
15 virtual bool Configuration(std::string Message
) APT_OVERRIDE
17 if (pkgAcqMethod::Configuration(Message
) == false)
20 std::string
const conf
= std::string("Binary::") + Binary
;
21 _config
->MoveSubTree(conf
.c_str(), NULL
);
28 bool CalculateHashes(FetchItem
const * const Itm
, FetchResult
&Res
) const
30 Hashes
Hash(Itm
->ExpectedHashes
);
32 if (Fd
.Open(Res
.Filename
, FileFd::ReadOnly
) == false || Hash
.AddFD(Fd
) == false)
38 void Warning(const char *Format
,...)
41 va_start(args
,Format
);
42 PrintStatus("104 Warning", Format
, args
);
46 aptMethod(char const * const Binary
, char const * const Ver
, unsigned long const Flags
) :
47 pkgAcqMethod(Ver
, Flags
), Binary(Binary
)
50 std::locale::global(std::locale(""));
52 setlocale(LC_ALL
, "");