summaryrefslogtreecommitdiff
path: root/apt-pkg/indexfile.h
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-06-11 11:59:16 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2015-06-11 11:59:16 +0200
commit001c76fe204e17916a6c8b351ff30b67d32cb779 (patch)
tree5ce4ec8dca05a152e6ecb2daf436cf2b5b0a9a96 /apt-pkg/indexfile.h
parente3c1cfc767f17f5e9b2cd99f2658db3d6ac8edd9 (diff)
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
Diffstat (limited to 'apt-pkg/indexfile.h')
-rw-r--r--apt-pkg/indexfile.h16
1 files changed, 14 insertions, 2 deletions
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<std::string, std::string> Options;
IndexTarget(std::string const &MetaKey, std::string const &ShortDesc,
std::string const &LongDesc, std::string const &URI, bool const IsOptional,
std::map<std::string, std::string> 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;
};
/*}}}*/