diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2022-01-04 17:39:16 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2022-01-04 18:00:33 +0100 |
commit | 6d9a6d2cc3a20c9047436d174c9f91a2223da220 (patch) | |
tree | 2bf36cb443a80f56db38e10c8afe2c749ff3bdcc /src/libexpr/value.hh | |
parent | 1ffacad8a5201713659d5e18db47b2020bdc6aa1 (diff) |
Ensure that attrsets are sorted
Previously you had to remember to call value->attrs->sort() after
populating value->attrs. Now there is a BindingsBuilder helper that
wraps Bindings and ensures that sort() is called before you can use
it.
Diffstat (limited to 'src/libexpr/value.hh')
-rw-r--r-- | src/libexpr/value.hh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libexpr/value.hh b/src/libexpr/value.hh index 6b4f3c0ae..a8fea02dc 100644 --- a/src/libexpr/value.hh +++ b/src/libexpr/value.hh @@ -10,6 +10,8 @@ namespace nix { +class BindingsBuilder; + typedef enum { tInt = 1, @@ -235,6 +237,10 @@ public: string.context = context; } + void mkString(std::string_view s); + + void mkString(std::string_view s, const PathSet & context); + inline void mkPath(const char * s) { clearValue(); @@ -255,6 +261,8 @@ public: attrs = a; } + Value & mkAttrs(BindingsBuilder & bindings); + inline void mkList(size_t size) { clearValue(); |