From 749dd97a54f50467d266dde2b833f272cb556145 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 30 Jun 2009 15:53:39 +0000 Subject: * Support integers and lists of strings in meta fields. This is useful for fields like meta.maintainers, meta.priority (which can be a proper integer now) and even meta.license (if there are multiple licenses). --- src/libexpr/get-drvs.hh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/libexpr/get-drvs.hh') diff --git a/src/libexpr/get-drvs.hh b/src/libexpr/get-drvs.hh index 46dc51a568af..b56f54711899 100644 --- a/src/libexpr/get-drvs.hh +++ b/src/libexpr/get-drvs.hh @@ -12,7 +12,16 @@ namespace nix { -typedef std::map MetaInfo; +struct MetaValue +{ + enum { tpNone, tpString, tpStrings, tpInt } type; + string stringValue; + Strings stringValues; + int intValue; +}; + + +typedef std::map MetaInfo; struct DrvInfo @@ -34,7 +43,7 @@ public: string queryDrvPath(EvalState & state) const; string queryOutPath(EvalState & state) const; MetaInfo queryMetaInfo(EvalState & state) const; - string queryMetaInfo(EvalState & state, const string & name) const; + MetaValue queryMetaInfo(EvalState & state, const string & name) const; void setDrvPath(const string & s) { -- cgit 1.4.1