TestHelper.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-08-15
  6. * Changed: 2023-05-18
  7. *
  8. * */
  9. #ifndef LS_STD_TEST_HELPER_HPP
  10. #define LS_STD_TEST_HELPER_HPP
  11. #include <string>
  12. #include <vector>
  13. namespace ls::std::test
  14. {
  15. class TestHelper
  16. {
  17. public:
  18. TestHelper();
  19. ~TestHelper();
  20. [[nodiscard]] static ::std::string getResourcesFolderLocation();
  21. [[nodiscard]] static ::std::string getTestFolderLocation();
  22. private:
  23. [[nodiscard]] static char _getFilePathSeparator();
  24. [[nodiscard]] static ::std::string _getParent(const ::std::string &_path);
  25. [[nodiscard]] static ::std::string _getWorkingDirectory();
  26. #if defined(unix) || defined(__APPLE__)
  27. [[nodiscard]] static ::std::string _getWorkingDirectoryUnix();
  28. #endif
  29. #ifdef _WIN32
  30. [[nodiscard]] static ::std::string _getWorkingDirectoryWindows();
  31. #endif
  32. [[nodiscard]] static ::std::string _normalizePath(::std::string _path);
  33. [[nodiscard]] static ::std::string _reduceSeparators(const ::std::string &_path);
  34. [[nodiscard]] static ::std::string _replaceWrongSeparator(::std::string _path);
  35. [[nodiscard]] static ::std::vector<::std::string> _splitIntoSubDirectoryNames(const ::std::string &_path);
  36. };
  37. }
  38. #endif