X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Futils.h;h=db6a32c74fcc684369f9345486bcabde28a02939;hp=47efcacd9ddb24e299411793ca745ada759ac829;hb=3004842aa3281f26137c7332089068da7edb34af;hpb=9dc69f850aab362348787353a55a900a5d72c5dc diff --git a/source/utils.h b/source/utils.h index 47efcac..db6a32c 100644 --- a/source/utils.h +++ b/source/utils.h @@ -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]==':'); }