| 104 | } |
| 105 | |
| 106 | mitk::XML2EventParser::XML2EventParser(const std::string &filename, const us::Module *module) |
| 107 | { |
| 108 | if (module == nullptr) |
| 109 | { |
| 110 | module = us::GetModuleContext()->GetModule(); |
| 111 | } |
| 112 | us::ModuleResource resource = module->GetResource("Interactions/" + filename); |
| 113 | if (!resource.IsValid()) |
| 114 | { |
| 115 | MITK_ERROR << "Resource not valid. State machine pattern in module " << module->GetName() |
| 116 | << " not found: /Interactions/" << filename; |
| 117 | return; |
| 118 | } |
| 119 | |
| 120 | us::ModuleResourceStream stream(resource); |
| 121 | this->SetStream(&stream); |
| 122 | bool success = this->Parse(); |
| 123 | if (!success) |
| 124 | MITK_ERROR << "Error occurred during parsing of EventXML File."; |
| 125 | } |
| 126 | |
| 127 | mitk::XML2EventParser::XML2EventParser(std::istream &inputStream) |
| 128 | { |
nothing calls this directly
no test coverage detected