]> git.tdb.fi Git - libs/core.git/blobdiff - source/utils.h
Add is_dir and get_home_dir functions
[libs/core.git] / source / utils.h
index 47efcacd9ddb24e299411793ca745ada759ac829..db6a32c74fcc684369f9345486bcabde28a02939 100644 (file)
@@ -53,6 +53,9 @@ std::string basename(const std::string &);
 /// Tests for existence of a file
 bool exists(const Path &path);
 
+/// Tests whether a path refers to an existing directory
+bool is_dir(const Path &paht);
+
 /**
 Gets information about a file.  Returns 0 on success or -1 on error.  This
 version can be used to check for file existence and get information in one
@@ -68,6 +71,9 @@ struct stat stat(const Path &fn);
 
 Path getcwd();
 
+/// Returns the user's home directory
+Path get_home_dir();
+
 inline bool is_windows_drive(const std::string &p)
 { return (p.size()==2 && ((p[0]>='A' && p[0]<='Z') || (p[0]>='a' && p[0]<='z')) && p[1]==':'); }