about summary refs log tree commit diff
path: root/src/libutil
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/aterm.cc10
-rw-r--r--src/libutil/aterm.hh1
2 files changed, 11 insertions, 0 deletions
diff --git a/src/libutil/aterm.cc b/src/libutil/aterm.cc
index bb6e33ce92c0..90a8e212ef4d 100644
--- a/src/libutil/aterm.cc
+++ b/src/libutil/aterm.cc
@@ -41,3 +41,13 @@ ATerm nix::toATerm(const string & s)
 {
     return toATerm(s.c_str());
 }
+
+
+ATermList nix::toATermList(const StringSet & ss)
+{
+    ATermList l = ATempty;
+    for (StringSet::const_reverse_iterator i = ss.rbegin();
+         i != ss.rend(); ++i)
+        l = ATinsert(l, toATerm(*i));
+    return l;
+}
diff --git a/src/libutil/aterm.hh b/src/libutil/aterm.hh
index 6a2415f0b7fb..b1cbc3b6d895 100644
--- a/src/libutil/aterm.hh
+++ b/src/libutil/aterm.hh
@@ -43,6 +43,7 @@ Error badTerm(const format & f, ATerm t);
 ATerm toATerm(const char * s);
 ATerm toATerm(const string & s);
 
+ATermList toATermList(const StringSet & ss);
  
 }