TestHelper.hpp 1.2 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-02-23
  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. private:
  23. static char _getFilePathSeparator();
  24. static ::std::string _getParent(const ::std::string &_path);
  25. static ::std::string _getWorkingDirectory();
  26. #if defined(unix) || defined(__APPLE__)
  27. static ::std::string _getWorkingDirectoryUnix();
  28. #endif
  29. #ifdef _WIN32
  30. static ::std::string _getWorkingDirectoryWindows();
  31. #endif
  32. static ::std::string _normalizePath(::std::string _path);
  33. static ::std::string _reduceSeparators(const ::std::string &_path);
  34. static ::std::string _replaceWrongSeparator(::std::string _path);
  35. static ::std::vector<::std::string> _splitIntoSubDirectoryNames(const ::std::string &_path);
  36. };
  37. }
  38. #endif