]> git.tdb.fi Git - libs/core.git/blobdiff - source/utils.h
Move is_windows_drive into utils.h
[libs/core.git] / source / utils.h
index e0c559d0450a47a2f79c873609f4ac76e32bfe0d..961ad499674666629ecc7b635d04032e2b5d63ac 100644 (file)
@@ -35,6 +35,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