MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / load

Method load

src/openms_gui/source/VISUAL/TOPPASResources.cpp:41–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39 }
40
41 void TOPPASResources::load(const QString& file_name)
42 {
43 Param load_param;
44 ParamXMLFile paramFile;
45 paramFile.load(String(file_name), load_param);
46
47 for (Param::ParamIterator it = load_param.begin(); it != load_param.end(); ++it)
48 {
49 StringList substrings;
50 String(it.getName()).split(':', substrings);
51 if (substrings.size() != 2 ||
52 substrings.back() != "url_list" ||
53 (it->value).valueType() != ParamValue::STRING_LIST)
54 {
55 std::cerr << "Invalid file format." << std::endl;
56 return;
57 }
58
59 QString key = (substrings[0]).toQString();
60 StringList url_list = ListUtils::toStringList<std::string>(it->value);
61 QList<TOPPASResource> resource_list;
62 for (StringList::const_iterator it = url_list.begin(); it != url_list.end(); ++it)
63 {
64 resource_list << TOPPASResource(QUrl(it->toQString()));
65 }
66
67 add(key, resource_list);
68 }
69 }
70
71 void TOPPASResources::add(const QString& key, const QList<TOPPASResource>& resource_list)
72 {

Callers

nothing calls this directly

Calls 9

addFunction · 0.85
backMethod · 0.80
StringClass · 0.50
beginMethod · 0.45
endMethod · 0.45
splitMethod · 0.45
getNameMethod · 0.45
sizeMethod · 0.45
toQStringMethod · 0.45

Tested by

no test coverage detected