about summary refs log tree commit diff
path: root/src/util.hh
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-10-07T14·37+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-10-07T14·37+0000
commitb9f4942bd2f8aae44db6caa5a4ebe5680880fec2 (patch)
tree96314f11abf3584694b6ea818064deec2b007677 /src/util.hh
parent5d4171f7fb548e06ecd2440f57322b3c77f1074e (diff)
* string -> Path.
Diffstat (limited to 'src/util.hh')
-rw-r--r--src/util.hh22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/util.hh b/src/util.hh
index 31dba7fafe..016289176b 100644
--- a/src/util.hh
+++ b/src/util.hh
@@ -42,6 +42,12 @@ typedef list<string> Strings;
 typedef set<string> StringSet;
 
 
+/* Paths are just strings. */
+typedef string Path;
+typedef list<Path> Paths;
+typedef set<Path> PathSet;
+
+
 /* The canonical system name, as returned by config.guess. */ 
 extern string thisSystem;
 
@@ -49,31 +55,31 @@ extern string thisSystem;
 /* Return an absolutized path, resolving paths relative to the
    specified directory, or the current directory otherwise.  The path
    is also canonicalised. */
-string absPath(string path, string dir = "");
+Path absPath(Path path, Path dir = "");
 
 /* Canonicalise a path (as in realpath(3)). */
-string canonPath(const string & path);
+Path canonPath(const Path & path);
 
 /* Return the directory part of the given path, i.e., everything
    before the final `/'. */
-string dirOf(string path);
+Path dirOf(const Path & path);
 
 /* Return the base name of the given path, i.e., everything following
    the final `/'. */
-string baseNameOf(string path);
+string baseNameOf(const Path & path);
 
 /* Return true iff the given path exists. */
-bool pathExists(const string & path);
+bool pathExists(const Path & path);
 
 /* Delete a path; i.e., in the case of a directory, it is deleted
    recursively.  Don't use this at home, kids. */
-void deletePath(const string & path);
+void deletePath(const Path & path);
 
 /* Make a path read-only recursively. */
-void makePathReadOnly(const string & path);
+void makePathReadOnly(const Path & path);
 
 /* Create a temporary directory. */
-string createTempDir();
+Path createTempDir();
 
 
 /* Messages. */