MCPcopy Create free account
hub / github.com/MITK/MITK / GetDataFile

Method GetDataFile

Modules/CppMicroServices/src/usModuleContext.cpp:160–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158}
159
160std::string ModuleContext::GetDataFile(const std::string &filename) const
161{
162 // compute the module storage path
163#ifdef US_PLATFORM_WINDOWS
164 static const char separator = '\\';
165#else
166 static const char separator = '/';
167#endif
168
169 std::string baseStoragePath = ModuleSettings::GetStoragePath();
170 if (baseStoragePath.empty()) return std::string();
171 if (baseStoragePath != d->module->baseStoragePath)
172 {
173 d->module->baseStoragePath = baseStoragePath;
174 d->module->storagePath.clear();
175 }
176
177 if (d->module->storagePath.empty())
178 {
179 char buf[50];
180 snprintf(buf, sizeof(buf), "%ld", d->module->info.id);
181 d->module->storagePath = baseStoragePath + separator + buf + "_" + d->module->info.name + separator;
182 }
183 return d->module->storagePath + filename;
184}
185
186
187}

Callers 3

frame010aFunction · 0.80
frame020aFunction · 0.80

Calls 2

emptyMethod · 0.45
clearMethod · 0.45

Tested by 2

frame010aFunction · 0.64
frame020aFunction · 0.64