FilePathSeparator.cpp 847 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2023-02-04
  6. * Changed: 2023-02-04
  7. *
  8. * */
  9. #include <ls-std/io/FilePathSeparator.hpp>
  10. ls::std::io::FilePathSeparator::FilePathSeparator() = default;
  11. ls::std::io::FilePathSeparator::~FilePathSeparator() = default;
  12. char ls::std::io::FilePathSeparator::get()
  13. {
  14. char separator;
  15. #ifdef _WIN32
  16. separator = ls::std::io::FilePathSeparator::getWindowsFilePathSeparator();
  17. #endif
  18. #if defined(unix) || defined(__APPLE__)
  19. separator = ls::std::io::FilePathSeparator::getUnixFilePathSeparator();
  20. #endif
  21. return separator;
  22. }
  23. char ls::std::io::FilePathSeparator::getUnixFilePathSeparator()
  24. {
  25. return '/';
  26. }
  27. char ls::std::io::FilePathSeparator::getWindowsFilePathSeparator()
  28. {
  29. return '\\';
  30. }