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.

File.cpp 509B

123456789101112131415161718192021222324252627
  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) : path(file) {
  12. size_t pos = file.rfind('/', file.length() - 2);
  13. name = file.substr(pos + 1);
  14. std::transform(name.begin(), name.end(), name.begin(), ::tolower);
  15. }
  16. std::string& File::getName() {
  17. return name;
  18. }
  19. std::string& File::getPath() {
  20. return path;
  21. }