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.

Path.cpp 425B

123456789101112131415161718192021
  1. #include "Path.h"
  2. #include <sys/stat.h>
  3. bool Path::directoryExists(const std::string &path) {
  4. struct stat sb;
  5. if (stat(path.c_str(), &sb) == 0 && S_ISDIR(sb.st_mode)) {
  6. return true;
  7. }
  8. return false;
  9. }
  10. std::string Path::fromUnixPath(const std::string &path) {
  11. std::string returnPath(path);
  12. #ifdef _WIN32
  13. for (int i = 0; i < path.size(); i++)
  14. if (path.at(i) == '/') path.at(i) = '\\';
  15. #endif
  16. return returnPath;
  17. }