You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

21 lines
431 B

#include "Path.h"
#include <sys/stat.h>
bool Path::directoryExists(const std::string &path) {
struct stat sb;
if (stat(path.c_str(), &sb) == 0 && S_ISDIR(sb.st_mode)) {
return true;
}
return false;
}
std::string Path::fromUnixPath(const std::string &path) {
std::string returnPath(path);
#ifdef _WIN32
for (int i = 0; i < path.size(); i++)
if (path.at(i) == '/') returnPath.at(i) = '\\';
#endif
return returnPath;
}