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

Method getDataPath

Platforms/OpenGL3/OpenGL3Platform/src/MyGUI_OpenGL3DataManager.cpp:81–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

loadFileContentMethod · 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