| 115 | } |
| 116 | |
| 117 | void Content::setWritablePath(String writablePath) { |
| 118 | #if BX_PLATFORM_OSX || BX_PLATFORM_WINDOWS || BX_PLATFORM_LINUX || BX_PLATFORM_ANDROID |
| 119 | if (_writablePath == writablePath) { |
| 120 | return; |
| 121 | } |
| 122 | std::error_code err; |
| 123 | std::string fullPath = fs::absolute(writablePath.toString(), err).lexically_normal().string(); |
| 124 | if (err) { |
| 125 | Issue("got invalid writable path \"{}\"", writablePath.toString()); |
| 126 | } |
| 127 | if (fs::exists(fullPath, err)) { |
| 128 | _writablePath = fullPath; |
| 129 | trimTrailingSlashes(_writablePath); |
| 130 | } else { |
| 131 | Issue("got invalid writable path \"{}\"", writablePath.toString()); |
| 132 | } |
| 133 | #else |
| 134 | Issue("changing writable path is not supported on platform \"{}\"", SharedApplication.getPlatform().toString()); |
| 135 | #endif |
| 136 | } |
| 137 | |
| 138 | const std::string& Content::getWritablePath() const noexcept { |
| 139 | return _writablePath; |
no test coverage detected