TestHelper.hpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-08-15
  6. * Changed: 2023-02-05
  7. *
  8. * */
  9. #ifndef LS_STD_IO_TEST_HELPER_HPP
  10. #define LS_STD_IO_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. static ::std::string getResourcesFolderLocation();
  21. static ::std::string getTestFolderLocation();
  22. static ::std::string normalize(const ::std::string &_path);
  23. private:
  24. static char _getFilePathSeparator();
  25. static ::std::string _getParent(const ::std::string &_path);
  26. static ::std::string _getWorkingDirectory();
  27. #if defined(unix) || defined(__APPLE__)
  28. static ::std::string _getWorkingDirectoryUnix();
  29. #endif
  30. #ifdef _WIN32
  31. static ::std::string _getWorkingDirectoryWindows();
  32. #endif
  33. static ::std::string _normalizePath(::std::string _path);
  34. static ::std::string _reduceSeparators(const ::std::string &_path);
  35. static ::std::string _replaceWrongSeparator(::std::string _path);
  36. static ::std::vector<::std::string> _splitIntoSubDirectoryNames(const ::std::string &_path);
  37. };
  38. }
  39. #endif