#include <apt-pkg/indexfile.h>
#include <apt-pkg/metaindex.h>
-#include <stddef.h>
+#include <apt-pkg/debmetaindex.h>
#include <string>
#include <vector>
metaIndex::metaIndex(std::string const &URI, std::string const &Dist,
char const * const Type)
: d(NULL), Indexes(NULL), Type(Type), URI(URI), Dist(Dist), Trusted(TRI_UNSET),
- LoadedSuccessfully(TRI_UNSET),
- Date(0), ValidUntil(0), SupportsAcquireByHash(false)
+ Date(0), ValidUntil(0), SupportsAcquireByHash(false), LoadedSuccessfully(TRI_UNSET)
{
/* nothing */
}
metaIndex::~metaIndex()
{
- if (Indexes == 0)
- return;
- for (std::vector<pkgIndexFile *>::iterator I = (*Indexes).begin();
- I != (*Indexes).end(); ++I)
- delete *I;
- delete Indexes;
+ if (Indexes != 0)
+ {
+ for (std::vector<pkgIndexFile *>::iterator I = (*Indexes).begin();
+ I != (*Indexes).end(); ++I)
+ delete *I;
+ delete Indexes;
+ }
+ for (auto const &E: Entries)
+ delete E.second;
}
// one line Getters for public fields /*{{{*/
APT_PURE std::string metaIndex::GetDist() const { return Dist; }
APT_PURE const char* metaIndex::GetType() const { return Type; }
APT_PURE metaIndex::TriState metaIndex::GetTrusted() const { return Trusted; }
+APT_PURE std::string metaIndex::GetSignedBy() const { return SignedBy; }
APT_PURE std::string metaIndex::GetCodename() const { return Codename; }
APT_PURE std::string metaIndex::GetSuite() const { return Suite; }
APT_PURE bool metaIndex::GetSupportsAcquireByHash() const { return SupportsAcquireByHash; }
std::swap(LoadedSuccessfully, OldMetaIndex->LoadedSuccessfully);
}
/*}}}*/
+
+bool metaIndex::IsArchitectureSupported(std::string const &arch) const /*{{{*/
+{
+ debReleaseIndex const * const deb = dynamic_cast<debReleaseIndex const *>(this);
+ if (deb != NULL)
+ return deb->IsArchitectureSupported(arch);
+ return true;
+}
+ /*}}}*/