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

Method AddConfigsFromResources

Modules/DICOM/src/mitkDICOMFileReaderSelector.cpp:40–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40void
41mitk::DICOMFileReaderSelector
42::AddConfigsFromResources(const std::string& path)
43{
44 if (nullptr == us::GetModuleContext()) return;
45
46 const std::vector<us::ModuleResource> configs =
47 us::GetModuleContext()->GetModule()->FindResources( path, "*.xml", false );
48
49 for ( auto iter = configs.cbegin(); iter != configs.cend(); ++iter )
50 {
51 us::ModuleResource resource = *iter;
52 if (resource.IsValid())
53 {
54 us::ModuleResourceStream stream(resource);
55
56 // read all into string s
57 std::string s;
58
59 stream.seekg(0, std::ios::end);
60 s.reserve(stream.tellg());
61 stream.seekg(0, std::ios::beg);
62
63 s.assign((std::istreambuf_iterator<char>(stream)),
64 std::istreambuf_iterator<char>());
65
66 this->AddConfig(s);
67 }
68 }
69}
70
71void
72mitk::DICOMFileReaderSelector

Callers 1

Calls 5

AddConfigMethod · 0.95
GetModuleContextFunction · 0.85
FindResourcesMethod · 0.80
GetModuleMethod · 0.45
IsValidMethod · 0.45

Tested by

no test coverage detected