aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/eval-cache.hh
diff options
context:
space:
mode:
authorpennae <82953136+pennae@users.noreply.github.com>2022-05-25 11:55:13 +0000
committerGitHub <noreply@github.com>2022-05-25 11:55:13 +0000
commitb092afe77d514ddbab02e20f8adf0acc58fa4aaf (patch)
tree13e9942f85a507525047d246ebd12ffaa3c813ac /src/libexpr/eval-cache.hh
parentd6d6bbd9ef1eed6443165866cd7bd27faa9586a1 (diff)
parent09e55010f9c7d0e60d7c97d1881cc696df3644ae (diff)
Merge branch 'master' into lto
Diffstat (limited to 'src/libexpr/eval-cache.hh')
-rw-r--r--src/libexpr/eval-cache.hh19
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();