MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / setWritablePath

Method setWritablePath

Source/Basic/Content.cpp:117–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117void 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
138const std::string& Content::getWritablePath() const noexcept {
139 return _writablePath;

Callers 1

Calls 7

absoluteFunction · 0.85
existsFunction · 0.85
trimTrailingSlashesFunction · 0.85
lexically_normalMethod · 0.80
getPlatformMethod · 0.80
toStringMethod · 0.65
stringMethod · 0.45

Tested by

no test coverage detected