From 001c76fe204e17916a6c8b351ff30b67d32cb779 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 11 Jun 2015 11:59:16 +0200 Subject: use an enum instead of strings as IndexTarget::Option interface Strings are easy to typo and we can keep the extensibility we require here with a simple enum we can append to without endangering ABI. Git-Dch: Ignore --- apt-pkg/indexfile.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'apt-pkg/indexfile.h') diff --git a/apt-pkg/indexfile.h b/apt-pkg/indexfile.h index e6e429c2c..c38cf0bf0 100644 --- a/apt-pkg/indexfile.h +++ b/apt-pkg/indexfile.h @@ -61,14 +61,26 @@ class IndexTarget /*{{{*/ /** \brief Is it okay if the file isn't found in the meta index */ bool IsOptional; - /** \brief Target specific options defined by the implementation */ + /** \brief options with which this target was created + Prefer the usage of #Option if at all possible. + Beware: Not all of these options are intended for public use */ std::map Options; IndexTarget(std::string const &MetaKey, std::string const &ShortDesc, std::string const &LongDesc, std::string const &URI, bool const IsOptional, std::map const &Options); - std::string Option(std::string const &Key) const; + enum OptionKeys { + SITE, + RELEASE, + COMPONENT, + LANGUAGE, + ARCHITECTURE, + BASE_URI, + REPO_URI, + CREATED_BY, + }; + std::string Option(OptionKeys const Key) const; }; /*}}}*/ -- cgit v1.2.3