MCPcopy Create free account
hub / github.com/MyGUI/mygui / getDataPath

Method getDataPath

Platforms/DirectX/DirectXPlatform/src/MyGUI_DirectXDataManager.cpp:86–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84 }
85
86 std::string DirectXDataManager::getDataPath(const std::string& _name) const
87 {
88 VectorString result;
89 common::VectorWString wresult;
90
91 for (const auto& path : mPaths)
92 {
93 common::scanFolder(wresult, path.name, path.recursive, MyGUI::UString(_name).asWStr(), true);
94 }
95
96 for (const auto& file : wresult)
97 {
98 result.push_back(MyGUI::UString(file).asUTF8());
99 }
100
101 if (!result.empty())
102 {
103 const std::string& path = result[0];
104 if (result.size() > 1)
105 {
106 MYGUI_PLATFORM_LOG(
107 Warning,
108 "There are several files with name '" << _name << "'. '" << path << "' was used.");
109 MYGUI_PLATFORM_LOG(Warning, "Other candidates are:");
110 for (size_t index = 1; index < result.size(); index++)
111 MYGUI_PLATFORM_LOG(Warning, " - '" << result[index] << "'");
112 }
113 return path;
114 }
115
116 return {};
117 }
118
119 void DirectXDataManager::addResourceLocation(const std::string& _name, bool _recursive)
120 {

Callers 1

loadFromFileMethod · 0.45

Calls 5

scanFolderFunction · 0.85
UStringFunction · 0.85
push_backMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected