diff options
Diffstat (limited to 'src/libexpr/eval-cache.hh')
-rw-r--r-- | src/libexpr/eval-cache.hh | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/libexpr/eval-cache.hh b/src/libexpr/eval-cache.hh index f4481c72a..c93e55b93 100644 --- a/src/libexpr/eval-cache.hh +++ b/src/libexpr/eval-cache.hh @@ -44,12 +44,15 @@ enum AttrType { Misc = 4, Failed = 5, Bool = 6, + ListOfStrings = 7, + Int = 8, }; struct placeholder_t {}; struct missing_t {}; struct misc_t {}; struct failed_t {}; +struct int_t { NixInt x; }; typedef uint64_t AttrId; typedef std::pair<AttrId, Symbol> AttrKey; typedef std::pair<std::string, NixStringContext> string_t; @@ -61,7 +64,9 @@ typedef std::variant< missing_t, misc_t, failed_t, - bool + bool, + int_t, + std::vector<std::string> > AttrValue; class AttrCursor : public std::enable_shared_from_this<AttrCursor> @@ -96,9 +101,13 @@ public: Suggestions getSuggestionsForAttr(Symbol name); - std::shared_ptr<AttrCursor> maybeGetAttr(std::string_view name, bool forceErrors = false); + std::shared_ptr<AttrCursor> maybeGetAttr(Symbol name, bool forceErrors = false); - ref<AttrCursor> getAttr(std::string_view name, bool forceErrors = false); + std::shared_ptr<AttrCursor> maybeGetAttr(std::string_view name); + + ref<AttrCursor> getAttr(Symbol name, bool forceErrors = false); + + ref<AttrCursor> getAttr(std::string_view name); /* Get an attribute along a chain of attrsets. Note that this does not auto-call functors or functions. */ @@ -110,6 +119,10 @@ public: bool getBool(); + NixInt getInt(); + + std::vector<std::string> getListOfStrings(); + std::vector<Symbol> getAttrs(); bool isDerivation(); |