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

Method getDataPath

Wrappers/MyGUI_Export/MyGUI_ExportDataManager.cpp:90–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 12

Gui.hFile · 0.45
loadImageMethod · 0.45
loadImageMethod · 0.45
loadImageMethod · 0.45
loadMethod · 0.45
createSceneMethod · 0.45
notifyGeneratePressedMethod · 0.45
createSceneMethod · 0.45
loadMethod · 0.45
createSceneMethod · 0.45
createSceneMethod · 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