aboutsummaryrefslogtreecommitdiff
path: root/src/libfetchers/attrs.hh
diff options
context:
space:
mode:
authorCarlo Nucera <carlo.nucera@protonmail.com>2020-07-28 15:36:45 -0400
committerCarlo Nucera <carlo.nucera@protonmail.com>2020-07-28 15:36:45 -0400
commitcfe96bd7ce06c3153b036447f9a933f2231a2029 (patch)
tree991e0e5b2adda907a9305e622fa54f7a401969d5 /src/libfetchers/attrs.hh
parentd9fb9e9f26e29d9d9001af700deada32ca740cf6 (diff)
parentb8eea7e81af53905be7845dffc6d0a83ea8edc97 (diff)
Merge branch 'master' of github.com:NixOS/nix into ca-drv
Diffstat (limited to 'src/libfetchers/attrs.hh')
-rw-r--r--src/libfetchers/attrs.hh11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/libfetchers/attrs.hh b/src/libfetchers/attrs.hh
index d6e0ae000..4b4630c80 100644
--- a/src/libfetchers/attrs.hh
+++ b/src/libfetchers/attrs.hh
@@ -13,9 +13,14 @@ namespace nix::fetchers {
template<typename T>
struct Explicit {
T t;
+
+ bool operator ==(const Explicit<T> & other) const
+ {
+ return t == other.t;
+ }
};
-typedef std::variant<std::string, int64_t, Explicit<bool>> Attr;
+typedef std::variant<std::string, uint64_t, Explicit<bool>> Attr;
typedef std::map<std::string, Attr> Attrs;
Attrs jsonToAttrs(const nlohmann::json & json);
@@ -26,9 +31,9 @@ std::optional<std::string> maybeGetStrAttr(const Attrs & attrs, const std::strin
std::string getStrAttr(const Attrs & attrs, const std::string & name);
-std::optional<int64_t> maybeGetIntAttr(const Attrs & attrs, const std::string & name);
+std::optional<uint64_t> maybeGetIntAttr(const Attrs & attrs, const std::string & name);
-int64_t getIntAttr(const Attrs & attrs, const std::string & name);
+uint64_t getIntAttr(const Attrs & attrs, const std::string & name);
std::optional<bool> maybeGetBoolAttr(const Attrs & attrs, const std::string & name);