Open Source Tomb Raider Engine
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

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. }