| 89 | } |
| 90 | |
| 91 | void Content::setAssetPath(String assetPath) { |
| 92 | #if BX_PLATFORM_OSX || BX_PLATFORM_WINDOWS || BX_PLATFORM_LINUX |
| 93 | std::error_code err; |
| 94 | std::string fullPath = fs::absolute(assetPath.toString(), err).lexically_normal().string(); |
| 95 | if (err) { |
| 96 | Issue("got invalid asset path \"{}\"", assetPath.toString()); |
| 97 | } |
| 98 | if (fs::exists(fullPath, err)) { |
| 99 | _assetPath = fullPath; |
| 100 | trimTrailingSlashes(_assetPath); |
| 101 | } else { |
| 102 | Issue("got invalid asset path \"{}\"", assetPath.toString()); |
| 103 | } |
| 104 | #else |
| 105 | Issue("changing asset path is not supported on platform \"{}\"", SharedApplication.getPlatform().toString()); |
| 106 | #endif |
| 107 | } |
| 108 | |
| 109 | const std::string& Content::getAssetPath() const noexcept { |
| 110 | return _assetPath; |
no test coverage detected