2 This file is part of libmsppath
3 Copyright © 2006 Mikko Rasa, Mikkosoft Productions
4 Distributed under the LGPL
6 #ifndef MSP_PATH_UTILS_H_
7 #define MSP_PATH_UTILS_H_
24 extern Path fix_case(const Path &);
25 extern int mkpath(const Path &, int);
26 extern int rmdir(const Path &, bool =false);
27 extern std::list<std::string> list_files(const Path &);
28 extern bool exists(const Path &);
29 extern Filename splitext(const std::string &);
30 extern int fnmatch(const std::string &, const Path &);
31 extern Path relative(const Path &, const Path &);
33 inline int stat(const Path &fn, struct stat &st)
34 { return ::stat(fn.str().c_str(), &st); }
37 { char buf[1024]; return ::getcwd(buf, sizeof(buf)); }
39 inline bool is_windows_drive(const std::string &p)
40 { return (p.size()==2 && ((p[0]>='A' && p[0]<='Z') || (p[0]>='a' && p[0]<='z')) && p[1]==':'); }