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

Method AddConfig

Modules/Core/src/Interactions/mitkEventConfig.cpp:328–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

326}
327
328bool mitk::EventConfig::AddConfig(const std::string &fileName, const us::Module *module)
329{
330 if (module == nullptr)
331 {
332 module = us::GetModuleContext()->GetModule();
333 }
334 us::ModuleResource resource = module->GetResource("Interactions/" + fileName);
335 if (!resource.IsValid())
336 {
337 MITK_ERROR << "Resource not valid. State machine pattern in module " << module->GetName()
338 << " not found: /Interactions/" << fileName;
339 return false;
340 }
341
342 EventConfig newConfig(*this);
343 us::ModuleResourceStream stream(resource);
344 newConfig.d->m_XmlParser.SetStream(&stream);
345 bool success = newConfig.d->m_XmlParser.Parse() && !newConfig.d->m_Errors;
346 if (success)
347 {
348 *this = newConfig;
349 }
350 return success;
351}
352
353bool mitk::EventConfig::AddConfig(const EventConfig &config)
354{

Callers 1

AddEventConfigMethod · 0.45

Calls 10

GetModuleContextFunction · 0.85
GetResourceMethod · 0.80
CopyMappingMethod · 0.80
GetModuleMethod · 0.45
IsValidMethod · 0.45
GetNameMethod · 0.45
SetStreamMethod · 0.45
ParseMethod · 0.45
CloneMethod · 0.45

Tested by

no test coverage detected