X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Futils.h;h=faf5ef7f261e038e2e1d688ec013d150b93369cd;hp=e0c559d0450a47a2f79c873609f4ac76e32bfe0d;hb=bfbb7edfb2ae76d23f26e0b22787617ff621747d;hpb=66bdaa1f9f833e18a07d061208ce6080f3abac06 diff --git a/source/utils.h b/source/utils.h index e0c559d..faf5ef7 100644 --- a/source/utils.h +++ b/source/utils.h @@ -28,6 +28,7 @@ extern std::list list_files(const Path &); extern bool exists(const Path &); extern Filename splitext(const std::string &); extern int fnmatch(const std::string &, const Path &); +extern Path relative(const Path &, const Path &); inline int stat(const Path &fn, struct stat &st) { return ::stat(fn.str().c_str(), &st); } @@ -35,6 +36,9 @@ inline int stat(const Path &fn, struct stat &st) inline Path getcwd() { char buf[1024]; return ::getcwd(buf, sizeof(buf)); } +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]==':'); } + } // namespace Path } // namespace Msp