Open Source Tomb Raider Engine
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.

1234567891011121314151617181920212223242526272829
  1. /*!
  2. * \file src/utils/File.cpp
  3. * \brief Recursive file-system walking utilities
  4. *
  5. * \author xythobuz
  6. */
  7. #include <algorithm>
  8. #include "global.h"
  9. #include "utils/File.h"
  10. #include "utils/Folder.h"
  11. File::File(std::string file) {
  12. path = file;
  13. size_t pos = path.rfind('/', path.length() - 2);
  14. name = path.substr(pos + 1);
  15. std::transform(name.begin(), name.end(), name.begin(), ::tolower);
  16. }
  17. std::string &File::getName() {
  18. return name;
  19. }
  20. std::string &File::getPath() {
  21. return path;
  22. }