aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/util.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/util.hh')
-rw-r--r--src/libutil/util.hh7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libutil/util.hh b/src/libutil/util.hh
index 20330fb76..7d20351ee 100644
--- a/src/libutil/util.hh
+++ b/src/libutil/util.hh
@@ -110,6 +110,9 @@ Paths createDirs(const Path & path);
/* Create a symlink. */
void createSymlink(const Path & target, const Path & link);
+/* Atomically create or replace a symlink. */
+void replaceSymlink(const Path & target, const Path & link);
+
template<class T, class A>
T singleton(const A & a)
@@ -334,6 +337,10 @@ string concatStringsSep(const string & sep, const StringSet & ss);
string chomp(const string & s);
+/* Remove whitespace from the start and end of a string. */
+string trim(const string & s, const string & whitespace = " \n\r\t");
+
+
/* Convert the exit status of a child as returned by wait() into an
error string. */
string statusToString(int status);