]> git.saurik.com Git - apt.git/blob - apt-pkg/metaindex.cc
Merge branch 'debian/jessie' into debian/experimental
[apt.git] / apt-pkg / metaindex.cc
1 // Include Files /*{{{*/
2 #include <apt-pkg/indexfile.h>
3 #include <apt-pkg/metaindex.h>
4
5 #include <stddef.h>
6
7 #include <string>
8 #include <vector>
9 /*}}}*/
10
11 #if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13)
12 std::string metaIndex::LocalFileName() const { return ""; }
13 #else
14 #include <apt-pkg/debmetaindex.h>
15 std::string metaIndex::LocalFileName() const
16 {
17 debReleaseIndex const * deb = dynamic_cast<debReleaseIndex const*>(this);
18 if (deb != NULL)
19 return deb->LocalFileName();
20
21 return "";
22 }
23 #endif
24
25 metaIndex::metaIndex(std::string const &URI, std::string const &Dist,
26 char const * const Type)
27 : Indexes(NULL), Type(Type), URI(URI), Dist(Dist), Trusted(false)
28 {
29 /* nothing */
30 }
31
32 metaIndex::~metaIndex()
33 {
34 if (Indexes == 0)
35 return;
36 for (std::vector<pkgIndexFile *>::iterator I = (*Indexes).begin();
37 I != (*Indexes).end(); ++I)
38 delete *I;
39 delete Indexes;
40 }