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

Method endElement

src/openms/source/FORMAT/HANDLERS/TraMLHandler.cpp:284–468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

282 }
283
284 void TraMLHandler::endElement(const XMLCh* const /*uri*/, const XMLCh* const /*local_name*/, const XMLCh* const qname)
285 {
286 tag_ = sm_.convert(qname);
287
288 //determine parent tag
289 String parent_tag;
290 if (open_tags_.size() > 1)
291 parent_tag = *(open_tags_.end() - 2);
292 String parent_parent_tag;
293 if (open_tags_.size() > 2)
294 parent_parent_tag = *(open_tags_.end() - 3);
295
296 open_tags_.pop_back();
297
298 static std::set<String> tags_to_ignore;
299 if (tags_to_ignore.empty())
300 {
301 tags_to_ignore.insert("TraML"); // base node
302 tags_to_ignore.insert("ContactList"); // contains only contact sections
303 tags_to_ignore.insert("CompoundList"); // contains only compounds
304 tags_to_ignore.insert("TransitionList"); // contains only transitions
305 tags_to_ignore.insert("ConfigurationList"); // contains only configurations
306 tags_to_ignore.insert("cvList"); // contains only CVs
307 tags_to_ignore.insert("InstrumentList"); // contains only instruments
308 tags_to_ignore.insert("SoftwareList"); // contains only software
309 tags_to_ignore.insert("PublicationList"); // contains only publications
310 tags_to_ignore.insert("ProteinList"); // contains only proteins
311 tags_to_ignore.insert("SourceFileList"); // contains only source files
312 tags_to_ignore.insert("InterpretationList"); // contains only interpretations
313 tags_to_ignore.insert("Evidence"); // only cv terms
314 tags_to_ignore.insert("cvParam"); // already handled
315 tags_to_ignore.insert("userParam"); // already handled
316 tags_to_ignore.insert("cv"); // already handled
317 tags_to_ignore.insert("Sequence"); // already handled in characters
318 tags_to_ignore.insert("Precursor"); // contains only cv terms
319 tags_to_ignore.insert("RetentionTimeList");
320 tags_to_ignore.insert("TargetList");
321 tags_to_ignore.insert("TargetIncludeList");
322 tags_to_ignore.insert("TargetExcludeList");
323 tags_to_ignore.insert("ProteinRef");
324 tags_to_ignore.insert("Modification");
325 tags_to_ignore.insert("TargetList");
326 }
327
328 // skip tags where nothing is to do
329 if (tags_to_ignore.find(tag_) != tags_to_ignore.end())
330 {
331 return;
332 }
333 else if (tag_ == "Contact")
334 {
335 exp_->addContact(actual_contact_);
336 actual_contact_ = TargetedExperiment::Contact();
337 }
338 else if (tag_ == "Instrument")
339 {
340 exp_->addInstrument(actual_instrument_);
341 actual_instrument_ = TargetedExperiment::Instrument();

Callers

nothing calls this directly

Calls 15

ContactFunction · 0.85
PublicationFunction · 0.85
RetentionTimeFunction · 0.85
PeptideFunction · 0.85
CompoundFunction · 0.85
InterpretationFunction · 0.85
ConfigurationClass · 0.85
addContactMethod · 0.80
addInstrumentMethod · 0.80
addPublicationMethod · 0.80
addSoftwareMethod · 0.80
addPeptideMethod · 0.80

Tested by

no test coverage detected