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

Method setAssetPath

Source/Basic/Content.cpp:91–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91void 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
109const std::string& Content::getAssetPath() const noexcept {
110 return _assetPath;

Callers 1

content_set_asset_pathFunction · 0.80

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