diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2020-02-26 14:19:10 +0100 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2020-02-26 14:19:10 +0100 |
commit | d77c1c7db760ae21d703b8b0f129379e54918bf7 (patch) | |
tree | bfc3899c4e85c9c57924aa6cf2fe608ad7d86920 | |
parent | d31f807a8d3f031d5efc5c3be9b76f9a9ac22d5d (diff) |
metaindex: Add Origin, Label, Version, DefaultPin, ReleaseNotes members
These were hidden behind the d-pointer previously.
-rw-r--r-- | apt-pkg/deb/debmetaindex.cc | 10 | ||||
-rw-r--r-- | apt-pkg/metaindex.cc | 30 | ||||
-rw-r--r-- | apt-pkg/metaindex.h | 11 |
3 files changed, 19 insertions, 32 deletions
diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index 2c0ab1d0d..a72f6d055 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -447,12 +447,12 @@ bool debReleaseIndex::Load(std::string const &Filename, std::string * const Erro // FIXME: find better tag name SupportsAcquireByHash = Section.FindB("Acquire-By-Hash", false); - SetOrigin(Section.FindS("Origin")); - SetLabel(Section.FindS("Label")); - SetVersion(Section.FindS("Version")); + Origin = Section.FindS("Origin"); + Label = Section.FindS("Label"); + Version = Section.FindS("Version"); Suite = Section.FindS("Suite"); Codename = Section.FindS("Codename"); - SetReleaseNotes(Section.FindS("Release-Notes")); + ReleaseNotes = Section.FindS("Release-Notes"); { std::string const archs = Section.FindS("Architectures"); if (archs.empty() == false) @@ -484,7 +484,7 @@ bool debReleaseIndex::Load(std::string const &Filename, std::string * const Erro else defaultpin = 1; } - SetDefaultPin(defaultpin); + DefaultPin = defaultpin; } bool FoundHashSum = false; diff --git a/apt-pkg/metaindex.cc b/apt-pkg/metaindex.cc index fe0d9c597..9a1e8a696 100644 --- a/apt-pkg/metaindex.cc +++ b/apt-pkg/metaindex.cc @@ -11,12 +11,6 @@ class metaIndexPrivate /*{{{*/ { - public: - std::string Origin; - std::string Label; - std::string Version; - signed short DefaultPin; - std::string ReleaseNotes; }; /*}}}*/ @@ -63,13 +57,13 @@ 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::GetOrigin() const { return d->Origin; } -APT_PURE std::string metaIndex::GetLabel() const { return d->Label; } -APT_PURE std::string metaIndex::GetVersion() const { return d->Version; } +APT_PURE std::string metaIndex::GetOrigin() const { return Origin; } +APT_PURE std::string metaIndex::GetLabel() const { return Label; } +APT_PURE std::string metaIndex::GetVersion() const { return Version; } APT_PURE std::string metaIndex::GetCodename() const { return Codename; } APT_PURE std::string metaIndex::GetSuite() const { return Suite; } -APT_PURE std::string metaIndex::GetReleaseNotes() const { return d->ReleaseNotes; } -APT_PURE signed short metaIndex::GetDefaultPin() const { return d->DefaultPin; } +APT_PURE std::string metaIndex::GetReleaseNotes() const { return ReleaseNotes; } +APT_PURE signed short metaIndex::GetDefaultPin() const { return DefaultPin; } APT_PURE bool metaIndex::GetSupportsAcquireByHash() const { return SupportsAcquireByHash; } APT_PURE time_t metaIndex::GetValidUntil() const { return ValidUntil; } APT_PURE time_t metaIndex::GetNotBefore() const @@ -137,10 +131,10 @@ void metaIndex::swapLoad(metaIndex * const OldMetaIndex) /*{{{*/ std::swap(Entries, OldMetaIndex->Entries); std::swap(LoadedSuccessfully, OldMetaIndex->LoadedSuccessfully); - OldMetaIndex->SetOrigin(d->Origin); - OldMetaIndex->SetLabel(d->Label); - OldMetaIndex->SetVersion(d->Version); - OldMetaIndex->SetDefaultPin(d->DefaultPin); + OldMetaIndex->Origin = Origin; + OldMetaIndex->Label = Label; + OldMetaIndex->Version =Version; + OldMetaIndex->DefaultPin = DefaultPin; } /*}}}*/ @@ -159,9 +153,3 @@ bool metaIndex::HasSupportForComponent(std::string const &component) const/*{{{* return true; } /*}}}*/ - -void metaIndex::SetOrigin(std::string const &origin) { d->Origin = origin; } -void metaIndex::SetLabel(std::string const &label) { d->Label = label; } -void metaIndex::SetVersion(std::string const &version) { d->Version = version; } -void metaIndex::SetDefaultPin(signed short const defaultpin) { d->DefaultPin = defaultpin; } -void metaIndex::SetReleaseNotes(std::string const ¬es) { d->ReleaseNotes = notes; } diff --git a/apt-pkg/metaindex.h b/apt-pkg/metaindex.h index 5e5efd5ff..015cb3621 100644 --- a/apt-pkg/metaindex.h +++ b/apt-pkg/metaindex.h @@ -44,6 +44,11 @@ protected: // parsed from a file std::string Suite; std::string Codename; + std::string Origin; + std::string Label; + std::string Version; + signed short DefaultPin; + std::string ReleaseNotes; time_t Date; time_t ValidUntil; bool SupportsAcquireByHash; @@ -105,12 +110,6 @@ public: virtual bool IsArchitectureSupported(std::string const &arch) const; virtual bool IsArchitectureAllSupportedFor(IndexTarget const &target) const; virtual bool HasSupportForComponent(std::string const &component) const; - // FIXME: should be members of the class on abi break - APT_HIDDEN void SetOrigin(std::string const &origin); - APT_HIDDEN void SetLabel(std::string const &label); - APT_HIDDEN void SetVersion(std::string const &version); - APT_HIDDEN void SetDefaultPin(signed short const defaultpin); - APT_HIDDEN void SetReleaseNotes(std::string const ¬es); }; #endif |